2024-11-17 20:28:14 +01:00
|
|
|
{
|
|
|
|
mkSystem =
|
2025-02-04 05:20:25 +01:00
|
|
|
{ hostConfig }:
|
|
|
|
{ inputs, ... }:
|
|
|
|
{
|
|
|
|
imports = [
|
2024-11-22 18:05:37 +01:00
|
|
|
inputs.impermanence.nixosModules.impermanence
|
2024-12-26 19:41:49 +01:00
|
|
|
inputs.sops-nix.nixosModules.sops
|
2024-12-26 17:22:00 +01:00
|
|
|
|
|
|
|
./systems/base/configuration.nix
|
|
|
|
(
|
|
|
|
{ ... }:
|
|
|
|
{
|
2024-12-26 19:41:49 +01:00
|
|
|
sops.defaultSopsFile = ./secrets + "/${hostConfig.hostname}.yaml";
|
2024-12-26 20:22:43 +01:00
|
|
|
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
2024-12-26 19:41:49 +01:00
|
|
|
# Disable automatic pgp key generation based on ssh keys
|
|
|
|
sops.gnupg.sshKeyPaths = [ ];
|
|
|
|
|
2025-02-03 17:23:12 +01:00
|
|
|
networking = {
|
|
|
|
hostName = hostConfig.hostname;
|
|
|
|
interfaces.ens18.ipv4.addresses = [
|
|
|
|
{
|
|
|
|
address = hostConfig.ip;
|
|
|
|
prefixLength = 24;
|
|
|
|
}
|
|
|
|
];
|
2025-02-03 17:27:53 +01:00
|
|
|
nameservers = [ "192.168.10.1" ];
|
2025-02-03 17:23:12 +01:00
|
|
|
defaultGateway = {
|
|
|
|
address = "192.168.10.1";
|
|
|
|
interface = "ens18";
|
|
|
|
};
|
|
|
|
};
|
2024-12-26 17:22:00 +01:00
|
|
|
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
|
|
|
}
|