remove inputs
We actually do not depend on any input here. Only if a nixosConfiguration should be instantiated, but it is already expected that the user will provide a (more up-to-date) nixpkgs flake that we use.
This commit is contained in:
parent
f3f83a56ab
commit
72f2a2ddc0
3 changed files with 18 additions and 63 deletions
|
|
@ -1,23 +1,19 @@
|
|||
{ 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.${nixpkgs}.lib.optional (inputs ? home-manager) {
|
||||
imports = [ inputs.home-manager.nixosModules.default ];
|
||||
config.home-manager = {
|
||||
sharedModules = [ hmModules.default ];
|
||||
extraSpecialArgs = { inherit flake namespace; };
|
||||
};
|
||||
}
|
||||
++ builtins.attrValues nixosUsers
|
||||
++ builtins.attrValues nixosGroups
|
||||
;
|
||||
};
|
||||
system = hostname: { 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/${hostname}"; })) flake.lib.schema.base)
|
||||
++ [ { config.networking.hostName = hostname; } ]
|
||||
++ [ nixosModules.default ]
|
||||
++ inputs.${nixpkgs}.lib.optional (inputs ? home-manager) {
|
||||
imports = [ inputs.home-manager.nixosModules.default ];
|
||||
config.home-manager = {
|
||||
sharedModules = [ hmModules.default ];
|
||||
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 (name: value: assert builtins.length value == 1; system name (builtins.head value)) host
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue