pkgs/dns-slaves: init

This commit is contained in:
Astro 2021-05-06 17:42:26 +02:00
parent 023282e0a1
commit 88e67c827b
2 changed files with 27 additions and 1 deletions

View File

@ -55,7 +55,11 @@ let
inherit self nixpkgs system; inherit self nixpkgs system;
}; };
dns-slaves = import ./dns-slaves.nix {
inherit self nixpkgs system;
};
in in
salt-pillars // rootfs-packages // vm-packages // device-templates // { salt-pillars // rootfs-packages // vm-packages // device-templates // {
inherit export-config; inherit export-config dns-slaves;
} }

22
nix/pkgs/dns-slaves.nix Normal file
View File

@ -0,0 +1,22 @@
{ self, nixpkgs, system }:
with nixpkgs.legacyPackages.${system};
writeText "named.slave.conf" (
lib.concatMapStringsSep "\n" ({ name, ns, ... }: ''
zone "${name}" IN {
type slave;
masters {
2a02:8106:208:5282:2::2;
fd23:42:c3d2:582:2::2;
172.20.73.2;
};
file "/var/lib/bind/slave/${name}.zone";
};
'') (
# public zones only
builtins.filter ({ ns, ... }:
ns == self.lib.dns.publicNS
) self.lib.dns.localZones
)
)