diff --git a/export/nixosConfigurations.nix b/export/nixosConfigurations.nix index e712097..023c980 100644 --- a/export/nixosConfigurations.nix +++ b/export/nixosConfigurations.nix @@ -1,19 +1,15 @@ -{ nixosUsers ? {}, nixosGroups ? {}, nixosModules, hmModules ? { default = {}; }, ...}@flake: { ... }@inputs: { host, ... }@imports: let - host' = name: snippets: let - system = { namespace?"fbs42", nixpkgs?"nixpkgs" }: inputs.${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 - ; - }; +{ 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 + ; + }; - cfg = assert builtins.length snippets == 1; builtins.head snippets; - in system cfg; - -in builtins.mapAttrs host' host +in builtins.mapAttrs (hostname: snippets: assert builtins.length snippets == 1; system hostname (builtins.head snippets)) host diff --git a/flake.lock b/flake.lock index 4782076..ea3f5dd 100644 --- a/flake.lock +++ b/flake.lock @@ -38,16 +38,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1751274312, - "narHash": "sha256-/bVBlRpECLVzjV19t5KMdMFWSwKLtb5RyXdjz3LJT+g=", + "lastModified": 1763966396, + "narHash": "sha256-6eeL1YPcY1MV3DDStIDIdy/zZCDKgHdkCmsrLJFiZf0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "50ab793786d9de88ee30ec4e4c24fb4236fc2674", + "rev": "5ae3b07d8d6527c42f17c876e404993199144b6a", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-24.11", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 5f5c238..808ef2a 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ { inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; hardware.url = "github:nixos/nixos-hardware"; home-manager = { url = "github:nix-community/home-manager/release-24.11";