summaryrefslogtreecommitdiff
path: root/sys/ns/nsd.nix
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2024-08-06 16:40:13 -0600
committerAlejandro Soto <alejandro@34project.org>2024-08-06 17:06:52 -0600
commitbcf936e19f78fc69572f0b748e83783899a55467 (patch)
treee603aa71ef08bfd5372f5a55abf9cfc5536502a0 /sys/ns/nsd.nix
parente6983cdadb763fe73dbd67231ea56dcf2288c96f (diff)
sys/ns: switch to vpsfree secondary dns
Diffstat (limited to 'sys/ns/nsd.nix')
-rw-r--r--sys/ns/nsd.nix14
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/ns/nsd.nix b/sys/ns/nsd.nix
index 29dd665..74fa7dd 100644
--- a/sys/ns/nsd.nix
+++ b/sys/ns/nsd.nix
@@ -5,9 +5,21 @@ in
{
options.local.ns.server = {
enable = mkEnableOption "nsd authoritative server";
+
+ tsigName = mkOption {
+ type = types.str;
+ default = "NOKEY";
+ };
};
config = mkIf cfg.enable {
+ assertions = [
+ {
+ assertion = cfg.tsigName == "NOKEY" || config.services.nsd.keys ? "${cfg.tsigName}";
+ message = "TSIG key '${cfg.tsigName}' not defined";
+ }
+ ];
+
networking.firewall =
let
inherit (config.services.nsd) port;
@@ -29,7 +41,7 @@ in
tcpTimeout = 30;
tcpQueryCount = 128;
- zones = mapAttrs (_: zone: zone.nsdConfig) config.local.ns.zones;
+ zones = mapAttrs' (name: zone: nameValuePair "${name}." zone.nsdConfig) config.local.ns.zones;
};
};
}