Compare commits
1 commit
74ac2c76d3
...
7ad8bb3192
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ad8bb3192 |
1 changed files with 17 additions and 13 deletions
|
|
@ -1,8 +1,9 @@
|
||||||
{ nixosUsers ? {}, nixosGroups ? {}, nixosModules, hmModules ? { default = {}; }, ...}@flake: { nixpkgs, ... }@inputs: { host, ... }@imports: let
|
{ nixosUsers ? {}, nixosGroups ? {}, nixosModules, hmModules ? { default = {}; }, ...}@flake: { nixpkgs, ... }@inputs: { host, ... }@imports: let
|
||||||
system = hostname: { namespace?"fbs42" }: nixpkgs.lib.nixosSystem {
|
host' = name: snippets: let
|
||||||
|
system = { namespace?"fbs42" }: nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = { inherit inputs flake namespace; };
|
specialArgs = { inherit inputs flake namespace; };
|
||||||
modules = builtins.concatLists (map (base: builtins.attrValues (flake.lib.scan { base = "${base}/host/${hostname}"; })) flake.lib.schema.base)
|
modules = builtins.concatLists (map (base: builtins.attrValues (flake.lib.scan { base = "${base}/host/${name}"; })) flake.lib.schema.base)
|
||||||
++ [ { config.networking.hostName = hostname; } ]
|
++ [ { config.networking.hostName = name; } ]
|
||||||
++ [ nixosModules.default ]
|
++ [ nixosModules.default ]
|
||||||
++ [ inputs.home-manager.nixosModules.default ]
|
++ [ inputs.home-manager.nixosModules.default ]
|
||||||
++ [ { config.home-manager.sharedModules = [ hmModules.default ]; } ]
|
++ [ { config.home-manager.sharedModules = [ hmModules.default ]; } ]
|
||||||
|
|
@ -12,4 +13,7 @@
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
|
|
||||||
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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue