Simplify flake.nix
This commit is contained in:
parent
2937154e38
commit
8f0ca00343
102
flake.nix
102
flake.nix
|
|
@ -47,98 +47,72 @@
|
|||
}@inputs:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
username = "josh";
|
||||
profile = "desktop";
|
||||
homePath = ./. + "/homes/${username}/home.nix";
|
||||
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
overlays = [ nix-vscode-extensions.overlays.default ];
|
||||
};
|
||||
|
||||
mkHost =
|
||||
{
|
||||
host,
|
||||
extraModules ? [ ],
|
||||
}:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = {
|
||||
inherit
|
||||
homePath
|
||||
host
|
||||
inputs
|
||||
profile
|
||||
username
|
||||
;
|
||||
};
|
||||
inherit pkgs;
|
||||
modules = [ ./hosts/${host} ] ++ extraModules;
|
||||
};
|
||||
in
|
||||
{
|
||||
nixosConfigurations = {
|
||||
laptop = let
|
||||
host = "laptop";
|
||||
profile = "desktop";
|
||||
username = "josh";
|
||||
in nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
inherit host;
|
||||
inherit profile;
|
||||
inherit username;
|
||||
};
|
||||
pkgs = pkgs;
|
||||
modules = [
|
||||
./hosts/${host}
|
||||
];
|
||||
};
|
||||
laptop = mkHost { host = "laptop"; };
|
||||
|
||||
vm = let
|
||||
host = "vm";
|
||||
profile = "desktop";
|
||||
username = "josh";
|
||||
in nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
inherit host;
|
||||
inherit profile;
|
||||
inherit username;
|
||||
};
|
||||
pkgs = pkgs;
|
||||
modules = [
|
||||
./hosts/${host}
|
||||
];
|
||||
};
|
||||
vm = mkHost { host = "vm"; };
|
||||
|
||||
live = let
|
||||
live = mkHost {
|
||||
host = "installation-iso";
|
||||
profile = "desktop";
|
||||
username = "josh";
|
||||
in nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
inherit host;
|
||||
inherit profile;
|
||||
inherit username;
|
||||
};
|
||||
pkgs = pkgs;
|
||||
modules = [
|
||||
extraModules = [
|
||||
(nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix")
|
||||
{ environment.systemPackages = [ install-system.packages.${system}.default ]; }
|
||||
./hosts/installation-iso
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
homeConfigurations.josh = let
|
||||
profile = "desktop";
|
||||
username = "josh";
|
||||
gpgSigningKey = null;
|
||||
in home-manager.lib.homeManagerConfiguration {
|
||||
extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
inherit profile;
|
||||
inherit username;
|
||||
};
|
||||
pkgs = pkgs;
|
||||
homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
|
||||
extraSpecialArgs = {
|
||||
inherit inputs profile username;
|
||||
};
|
||||
inherit pkgs;
|
||||
modules = [
|
||||
{
|
||||
modules.gpg.signingKey = gpgSigningKey;
|
||||
modules.gpg.signingKey = null;
|
||||
}
|
||||
./homes/josh/home.nix
|
||||
homePath
|
||||
stylix.homeModules.stylix
|
||||
];
|
||||
};
|
||||
|
||||
devShell.${system} = nixpkgs.legacyPackages.${system}.pkgs.mkShell {
|
||||
packages = with nixpkgs.legacyPackages.${system}.pkgs; [
|
||||
devShell.${system} = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
nil
|
||||
nixd
|
||||
];
|
||||
};
|
||||
|
||||
formatter.${system} = nixpkgs.legacyPackages.${system}.nixfmt-tree;
|
||||
formatter.${system} = pkgs.nixfmt-tree;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue