refactor(flakes): nicer helper functions
This commit is contained in:
48
flake.nix
48
flake.nix
@@ -91,67 +91,51 @@
|
|||||||
homeConfigurations = let
|
homeConfigurations = let
|
||||||
extraSpecialArgs = {inherit inputs outputs system;};
|
extraSpecialArgs = {inherit inputs outputs system;};
|
||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||||
|
defaultUserModules = [
|
||||||
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
|
];
|
||||||
|
withUserModules = modules: nixpkgs.lib.lists.flatten (defaultUserModules ++ [modules]);
|
||||||
in {
|
in {
|
||||||
"phundrak@alys" = home-manager.lib.homeManagerConfiguration {
|
"phundrak@alys" = home-manager.lib.homeManagerConfiguration {
|
||||||
inherit extraSpecialArgs pkgs;
|
inherit extraSpecialArgs pkgs;
|
||||||
modules = [
|
modules = withUserModules ./users/phundrak/host/alys.nix;
|
||||||
./users/phundrak/host/alys.nix
|
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
"phundrak@marpa" = home-manager.lib.homeManagerConfiguration {
|
"phundrak@marpa" = home-manager.lib.homeManagerConfiguration {
|
||||||
inherit extraSpecialArgs pkgs;
|
inherit extraSpecialArgs pkgs;
|
||||||
modules = [
|
modules = withUserModules ./users/phundrak/host/marpa.nix;
|
||||||
./users/phundrak/host/marpa.nix
|
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
"phundrak@gampo" = home-manager.lib.homeManagerConfiguration {
|
"phundrak@gampo" = home-manager.lib.homeManagerConfiguration {
|
||||||
inherit extraSpecialArgs pkgs;
|
inherit extraSpecialArgs pkgs;
|
||||||
modules = [
|
modules = withUserModules ./users/phundrak/host/gampo.nix;
|
||||||
./users/phundrak/host/gampo.nix
|
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
"phundrak@tilo" = home-manager.lib.homeManagerConfiguration {
|
"phundrak@tilo" = home-manager.lib.homeManagerConfiguration {
|
||||||
inherit extraSpecialArgs pkgs;
|
inherit extraSpecialArgs pkgs;
|
||||||
modules = [
|
modules = withUserModules ./users/phundrak/host/tilo.nix;
|
||||||
./users/phundrak/host/tilo.nix
|
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosConfigurations = let
|
nixosConfigurations = let
|
||||||
specialArgs = {inherit inputs outputs;};
|
specialArgs = {inherit inputs outputs;};
|
||||||
|
defaultSystemModules = [
|
||||||
|
inputs.sops-nix.nixosModules.sops
|
||||||
|
];
|
||||||
|
withSystemModules = modules: nixpkgs.lib.lists.flatten (defaultSystemModules ++ [modules]);
|
||||||
in {
|
in {
|
||||||
alys = nixpkgs.lib.nixosSystem {
|
alys = nixpkgs.lib.nixosSystem {
|
||||||
inherit specialArgs;
|
inherit specialArgs;
|
||||||
modules = [
|
modules = withSystemModules ./hosts/alys/configuration.nix;
|
||||||
./hosts/alys/configuration.nix
|
|
||||||
inputs.sops-nix.nixosModules.sops
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
gampo = nixpkgs.lib.nixosSystem {
|
gampo = nixpkgs.lib.nixosSystem {
|
||||||
inherit specialArgs;
|
inherit specialArgs;
|
||||||
modules = [
|
modules = withSystemModules ./hosts/gampo/configuration.nix;
|
||||||
./hosts/gampo/configuration.nix
|
|
||||||
inputs.sops-nix.nixosModules.sops
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
marpa = nixpkgs.lib.nixosSystem {
|
marpa = nixpkgs.lib.nixosSystem {
|
||||||
inherit specialArgs;
|
inherit specialArgs;
|
||||||
modules = [
|
modules = withSystemModules ./hosts/marpa/configuration.nix;
|
||||||
./hosts/marpa/configuration.nix
|
|
||||||
inputs.sops-nix.nixosModules.sops
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
tilo = nixpkgs.lib.nixosSystem {
|
tilo = nixpkgs.lib.nixosSystem {
|
||||||
inherit specialArgs;
|
inherit specialArgs;
|
||||||
modules = [
|
modules = withSystemModules ./hosts/tilo/configuration.nix;
|
||||||
./hosts/tilo/configuration.nix
|
|
||||||
inputs.sops-nix.nixosModules.sops
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user