diff --git a/nix/pkgs/dns-slaves.nix b/nix/pkgs/dns-slaves.nix index 9b0c906..a70e033 100644 --- a/nix/pkgs/dns-slaves.nix +++ b/nix/pkgs/dns-slaves.nix @@ -2,21 +2,25 @@ with nixpkgs.legacyPackages.${system}; +let + servConf = self.lib.config.site.net.serv; + masterAddrs = + [servConf.hosts4.dns] ++ + map (hosts6: hosts6.dns) + (builtins.attrValues servConf.hosts6); + mastersStr = + builtins.foldl' (result: addr: + "${result} ${addr};" + ) "" masterAddrs; +in + writeText "named.slave.conf" ( lib.concatMapStringsSep "\n" ({ name, ns, ... }: '' zone "${name}" IN { type slave; - masters { - 2a00:8180:2c00:282::2; - fd23:42:c3d2:582:2::2; - 172.20.73.2; - }; + masters {${mastersStr} }; file "/var/lib/bind/slave/${name}.zone"; - allow-notify { - 2a00:8180:2c00:282::2; - fd23:42:c3d2:582:2::2; - 172.20.73.2; - }; + allow-notify {${mastersStr} }; }; '') ( # public zones only