run nix format on this repository
This commit is contained in:
parent
1b5b697dfb
commit
d281a23a8a
17 changed files with 354 additions and 165 deletions
|
|
@ -1,19 +1,45 @@
|
|||
{ nixosUsers ? {}, nixosGroups ? {}, nixosModules, hmModules ? { default = {}; }, ...}@flake: { ... }@inputs: { host, ... }@imports: let
|
||||
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
|
||||
;
|
||||
};
|
||||
{
|
||||
nixosUsers ? { },
|
||||
nixosGroups ? { },
|
||||
nixosModules,
|
||||
hmModules ? {
|
||||
default = { };
|
||||
},
|
||||
...
|
||||
}@flake:
|
||||
{ ... }@inputs:
|
||||
{ host, ... }@imports:
|
||||
let
|
||||
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;
|
||||
};
|
||||
|
||||
in builtins.mapAttrs (name: value: assert builtins.length value == 1; system name (builtins.head value)) 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