49 lines
958 B
Nix
49 lines
958 B
Nix
{
|
|
inputs,
|
|
lib,
|
|
specialArgs,
|
|
repositoryModules,
|
|
|
|
# TODO refactor guests
|
|
guestFiles,
|
|
# TODO refactor registry
|
|
registryAssembly,
|
|
}:
|
|
let
|
|
mkHost =
|
|
{
|
|
root,
|
|
hostName,
|
|
}:
|
|
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 + "/${hostName}")
|
|
|
|
{
|
|
networking.hostName = hostName;
|
|
modules.host.enable = true;
|
|
}
|
|
];
|
|
};
|
|
in
|
|
{
|
|
mkHosts =
|
|
{ root }:
|
|
let
|
|
hostNames = lib.attrNames (lib.filterAttrs (_name: type: type == "directory") (builtins.readDir root));
|
|
in
|
|
lib.genAttrs hostNames (hostName: mkHost { inherit root hostName; });
|
|
}
|