From b99c7cf8ee87ea806e1593816fcac8bf33093bc1 Mon Sep 17 00:00:00 2001 From: niten Date: Thu, 5 Oct 2023 11:49:21 -0700 Subject: [PATCH] It's not even getting to zoneToZonefile... --- authoritative-dns.nix | 12 +++++++++--- nsd.nix | 2 +- zone-to-zonefile.nix | 5 ++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/authoritative-dns.nix b/authoritative-dns.nix index e3266eb..fd4760d 100644 --- a/authoritative-dns.nix +++ b/authoritative-dns.nix @@ -6,6 +6,8 @@ let zoneOpts = import ./zone-definition.nix { inherit lib; }; + zoneToZonefile = import ./zone-to-zonefile.nix { inherit lib; }; + domainOpts = { name, ... }: { options = with types; { domain = mkOption { @@ -75,9 +77,13 @@ in { zones = mapAttrs' (dom: domCfg: let zoneCfg = domCfg.zone; in nameValuePair "${dom}." { - dnssec = domCfg.ksk.key-file != null; - ksk.keyFile = domCfg.ksk.key-file; - data = zoneToZonefile cfg.timestamp dom domCfg.zone-definition; + dnssec = zoneCfg.ksk.key-file != null; + ksk.keyFile = + mkIf (zoneCfg.ksk.key-file != null) zoneCfg.ksk.key-file; + data = let + content = zoneToZonefile cfg.timestamp dom domCfg.zone-definition; + in trace content content; + }) cfg.domains; }; }; diff --git a/nsd.nix b/nsd.nix index c81b579..49d604e 100644 --- a/nsd.nix +++ b/nsd.nix @@ -167,7 +167,7 @@ let zone: name: "${name}" zonefile: "${stateDir}/zones/${mkZoneFileName name}" - + ${maybeConfig "outgoing-interface: " zone.outgoingInterface} ${forEach " rrl-whitelist: " zone.rrlWhitelist} ${maybeConfig "zonestats: " zone.zoneStats} diff --git a/zone-to-zonefile.nix b/zone-to-zonefile.nix index a9cb1f4..e45e178 100644 --- a/zone-to-zonefile.nix +++ b/zone-to-zonefile.nix @@ -1,9 +1,8 @@ -{ config, lib, pkgs, ... }: - -with lib; +{ lib, ... }: { timestamp, domain, zone, ... }: +with lib; let removeBlankLines = str: concatStringsSep "\n\n" (filter isString (split ''