52 lines
969 B
Nix
52 lines
969 B
Nix
{
|
|
inputs,
|
|
lib,
|
|
specialArgs,
|
|
repositoryModules,
|
|
|
|
# TODO refactor guests
|
|
guestFiles,
|
|
# TODO refactor registry
|
|
registryAssembly,
|
|
}:
|
|
let
|
|
mkHost =
|
|
{
|
|
root,
|
|
name,
|
|
}:
|
|
lib.nixosSystem {
|
|
inherit specialArgs;
|
|
modules =
|
|
guestFiles
|
|
++ [
|
|
inputs.chaotic.nixosModules.default
|
|
inputs.disko.nixosModules.disko
|
|
inputs.sops-nix.nixosModules.sops
|
|
inputs.stylix.nixosModules.stylix
|
|
|
|
repositoryModules
|
|
|
|
# TODO: refactor
|
|
registryAssembly.module (root + "/${name}")
|
|
|
|
{
|
|
networking.hostName = name;
|
|
modules.host.enable = true;
|
|
}
|
|
];
|
|
};
|
|
in
|
|
{
|
|
mkHosts =
|
|
{ root }:
|
|
let
|
|
directories = lib.filterAttrs (_name: type: type == "directory") (builtins.readDir root);
|
|
names = lib.attrNames directories;
|
|
in
|
|
lib.genAttrs names (
|
|
name:
|
|
mkHost { inherit root name; }
|
|
);
|
|
}
|