Files
clan-core/lib/build-clan/machineModules/forName.nix
DavHau 7cf065ae8c buildClan function: export all machines via nixosModules/darwinModules
We want each machine not only to be exposed via nixosConfigurations but also as a module.
This allows re-importing the machine in tests and override the architecture for example.
2025-06-09 12:51:22 +00:00

30 lines
478 B
Nix

{
name,
directory,
meta,
}:
{
_class,
lib,
...
}:
{
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"
]
);
clan.core.settings = {
inherit (meta) name icon;
inherit directory;
machine = {
inherit name;
};
};
}