Files
infrastructure/machines/modules/malobeo/zones.nix
2026-01-26 14:05:12 +01:00

40 lines
799 B
Nix

{ inputs }:
let
vpnNS = "vpn";
localNS = "hq";
peers = import ./peers.nix;
hosts = ((import ../../hosts.nix ) {}).malobeo.hosts;
in
{
SOA = {
nameServer = "ns1";
adminEmail = "admin@malobeo.org";
serial = 2019030800;
};
useOrigin = false;
NS = [
"ns1.malobeo.org."
];
A = [ "23.23.23.23" ]; #TODO: update
AAAA = [ "4321:0:1:2:3:4:567:89ab" ]; #TODO: update
subdomains = {
${localNS} = {
subdomains = builtins.mapAttrs (name: value: if value.network.local == true then {
A = [ value.network.address ];
} else {}) hosts;
};
${vpnNS} = {
A = [ peers.vpn.address ];
subdomains = builtins.mapAttrs (name: value: if value.role != "server" then {
A = [ value.address ];
} else {}) peers;
};
};
}