From 88e67c827b3271f27d35cae7bd6817859288902d Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 6 May 2021 17:42:26 +0200 Subject: [PATCH] pkgs/dns-slaves: init --- nix/pkgs/default.nix | 6 +++++- nix/pkgs/dns-slaves.nix | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 nix/pkgs/dns-slaves.nix diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index ab8ec72..f153c51 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -55,7 +55,11 @@ let inherit self nixpkgs system; }; + dns-slaves = import ./dns-slaves.nix { + inherit self nixpkgs system; + }; + in salt-pillars // rootfs-packages // vm-packages // device-templates // { - inherit export-config; + inherit export-config dns-slaves; } diff --git a/nix/pkgs/dns-slaves.nix b/nix/pkgs/dns-slaves.nix new file mode 100644 index 000000000..3009596 --- /dev/null +++ b/nix/pkgs/dns-slaves.nix @@ -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 + ) +)