I am preparing this such that we can move the forName modules into the defaults for the deferred module outputs and the forSystem modules are added later and only for the 'configsPerSystem' where we actually need the system modules
29 lines
508 B
Nix
29 lines
508 B
Nix
{
|
|
name,
|
|
directory,
|
|
}:
|
|
{
|
|
_class,
|
|
lib,
|
|
...
|
|
}:
|
|
{
|
|
imports = [
|
|
{
|
|
imports = builtins.filter builtins.pathExists (
|
|
[
|
|
"${directory}/machines/${name}/configuration.nix"
|
|
]
|
|
++ lib.optionals (_class == "nixos") [
|
|
"${directory}/machines/${name}/hardware-configuration.nix"
|
|
"${directory}/machines/${name}/disko.nix"
|
|
]
|
|
);
|
|
}
|
|
# TODO: move into nixos modules
|
|
({
|
|
networking.hostName = lib.mkDefault name;
|
|
})
|
|
];
|
|
}
|