1 {pkgs, lib, config, ...}:
 
   2 let inherit (builtins) toString toPath readFile;
 
   3     inherit (config) networking;
 
   4     inherit (config.services) nsd;
 
   5     serial = zone: toString (builtins.extraBuiltins.git ./. [ "log" "-1" "--format=%ct" "--" (zone + ".nix") ]);
 
   7     serial = file: lib.removeSuffix "\n" (readFile
 
   8       (pkgs.runCommand "zone-serial"
 
   9         { buildInputs      = [ pkgs.git ];
 
  10           buildDepends     = [ (toPath ./. + file) ];
 
  11           preferLocalBuild = true;
 
  12           allowSubstitutes = false;
 
  15         ${pkgs.git}/bin/git log -1 --format="%ct" -- ${file} >$out
 
  18     ipv4 = networking.zones.net.ipv4;
 
  33       ; SPF (Sender Policy Framework)
 
  34       @ 3600 IN SPF "v=spf1 mx ip4:${ipv4} -all"
 
  35       @ 3600 IN TXT "v=spf1 mx ip4:${ipv4} -all"
 
  41       _git._tcp.git 18000 IN SRV 0 0 9418 git
 
  48         # NOTE: cannot use networking.domain as attr key: infinite recursion
 
  51             $ORIGIN ${networking.domainBase}.org.
 
  54             ; SOA (Start Of Authority)
 
  56               ${serial networking.domainBase} ; Serial number
 
  60               1d      ; TTL (Time To Live) minimum
 
  70             $ORIGIN ${networking.domainBase}.coop.
 
  73             ; SOA (Start Of Authority)
 
  75               ${serial networking.domainBase} ; Serial number
 
  79               1d      ; TTL (Time To Live) minimum
 
  89             $ORIGIN ${networking.domainBase}.net.
 
  92             ; SOA (Start Of Authority)
 
  94               ${serial networking.domainBase} ; Serial number
 
  98               1d      ; TTL (Time To Live) minimum