1 {pkgs, lib, config, ...}:
2 let inherit (builtins) toString toPath readFile;
3 inherit (config.services) nsd;
4 serial = zone: toString (builtins.extraBuiltins.git ./. [ "log" "-1" "--format=%ct" "--" (zone + ".nix") ]);
6 serial = file: lib.removeSuffix "\n" (readFile
7 (pkgs.runCommand "zone-serial"
8 { buildInputs = [ pkgs.git ];
9 buildDepends = [ (toPath ./. + file) ];
10 preferLocalBuild = true;
11 allowSubstitutes = false;
14 ${pkgs.git}/bin/git log -1 --format="%ct" -- ${file} >$out
17 ipv4 = config.networking.zones.net.ipv4;
18 domain = "commonade.coop";
26 ; SOA (Start Of Authority)
28 ${serial domain} ; Serial number
32 1d ; TTL (Time To Live) minimum
47 ; SPF (Sender Policy Framework)
48 @ 3600 IN SPF "v=spf1 mx ip4:${ipv4} -all"
49 @ 3600 IN TXT "v=spf1 mx ip4:${ipv4} -all"
59 _git._tcp.git 18000 IN SRV 0 0 9418 git