diff --git a/export/nixosConfigurations.nix b/export/nixosConfigurations.nix index 023c980..a36134d 100644 --- a/export/nixosConfigurations.nix +++ b/export/nixosConfigurations.nix @@ -1,15 +1,19 @@ { nixosUsers ? {}, nixosGroups ? {}, nixosModules, hmModules ? { default = {}; }, ...}@flake: { nixpkgs, ... }@inputs: { host, ... }@imports: let - system = hostname: { namespace?"fbs42" }: nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs flake namespace; }; - modules = builtins.concatLists (map (base: builtins.attrValues (flake.lib.scan { base = "${base}/host/${hostname}"; })) flake.lib.schema.base) - ++ [ { config.networking.hostName = hostname; } ] - ++ [ nixosModules.default ] - ++ [ inputs.home-manager.nixosModules.default ] - ++ [ { config.home-manager.sharedModules = [ hmModules.default ]; } ] - ++ [ { config.home-manager.extraSpecialArgs = { inherit flake namespace; }; } ] - ++ builtins.attrValues nixosUsers - ++ builtins.attrValues nixosGroups - ; - }; + host' = name: snippets: let + system = { namespace?"fbs42" }: nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs flake namespace; }; + modules = builtins.concatLists (map (base: builtins.attrValues (flake.lib.scan { base = "${base}/host/${name}"; })) flake.lib.schema.base) + ++ [ { config.networking.hostName = name; } ] + ++ [ nixosModules.default ] + ++ [ inputs.home-manager.nixosModules.default ] + ++ [ { config.home-manager.sharedModules = [ hmModules.default ]; } ] + ++ [ { config.home-manager.extraSpecialArgs = { inherit flake namespace; }; } ] + ++ builtins.attrValues nixosUsers + ++ builtins.attrValues nixosGroups + ; + }; -in builtins.mapAttrs (hostname: snippets: assert builtins.length snippets == 1; system hostname (builtins.head snippets)) host + cfg = assert builtins.length snippets == 1; builtins.head snippets; + in system cfg; + +in builtins.mapAttrs host' host