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