automatically import ${namespace}.${class} as module #9
1 changed files with 4 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ let
|
||||||
{
|
{
|
||||||
namespace ? "fbs42",
|
namespace ? "fbs42",
|
||||||
nixpkgs ? "nixpkgs",
|
nixpkgs ? "nixpkgs",
|
||||||
|
classes ? [ hostname ],
|
||||||
}:
|
}:
|
||||||
inputs.${nixpkgs}.lib.nixosSystem {
|
inputs.${nixpkgs}.lib.nixosSystem {
|
||||||
specialArgs = { inherit inputs flake namespace; };
|
specialArgs = { inherit inputs flake namespace; };
|
||||||
|
|
@ -24,6 +25,9 @@ let
|
||||||
base: builtins.attrValues (flake.lib.scan { base = "${base}/host/${hostname}"; })
|
base: builtins.attrValues (flake.lib.scan { base = "${base}/host/${hostname}"; })
|
||||||
) flake.lib.schema.base
|
) flake.lib.schema.base
|
||||||
)
|
)
|
||||||
|
++ map (class: {
|
||||||
|
imports = map (input: input.${namespace}.${class} or { }) (builtins.attrValues inputs);
|
||||||
|
}) classes
|
||||||
++ [ { config.networking.hostName = hostname; } ]
|
++ [ { config.networking.hostName = hostname; } ]
|
||||||
++ [ nixosModules.default ]
|
++ [ nixosModules.default ]
|
||||||
++ inputs.${nixpkgs}.lib.optional (inputs ? home-manager) {
|
++ inputs.${nixpkgs}.lib.optional (inputs ? home-manager) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue