config/utils.nix

36 lines
786 B
Nix
Raw Normal View History

2024-11-17 20:28:14 +01:00
{
nixpkgs,
inputs,
outputs,
...
}:
{
mkSystem =
2024-12-26 17:22:00 +01:00
hostConfig:
2024-11-17 20:28:14 +01:00
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
2024-12-26 17:22:00 +01:00
inherit inputs outputs hostConfig;
2024-11-17 20:28:14 +01:00
};
2024-12-26 17:22:00 +01:00
modules = [
2024-11-22 18:05:37 +01:00
inputs.impermanence.nixosModules.impermanence
2024-12-26 17:22:00 +01:00
# inputs.sops-nix.nixosModules.sops
./systems/base/configuration.nix
(
{ ... }:
{
networking.hostName = hostConfig.hostname;
system.stateVersion = hostConfig.stateVersion;
}
)
({ ... }: hostConfig.config)
] ++ builtins.map (role: role.nixosModule) hostConfig.roles;
2024-11-17 20:28:14 +01:00
};
2024-12-26 17:22:00 +01:00
mkRole = cfg: {
inherit (cfg) name description nixosModule;
traefikRoutes = cfg.traefikRoutes or ({ ... }: [ ]);
};
2024-11-17 20:28:14 +01:00
}