1 { pkgs, lib, config, ... }:
4 inherit (builtins.extraBuiltins) pass git;
6 inherit (pkgs.lib) unlinesAttrs types;
7 inherit (config) networking;
8 inherit (config.services) nsd rspamd;
9 # Use the Git commit time of the ${domain}.nix file to set the serial number.
10 # WARNING: the ${domain}.nix must be committed into Git for this to work.
11 serial = domain: toString (git ./. [ "log" "-1" "--format=%ct" "--" (domain + ".nix") ]);
12 # FIXME: make dedicated config options
13 mermetIPv4 = "80.67.180.129";
14 chomskyIPv4 = "91.216.110.36";
15 domain = "autogeree.net";
18 services.nsd.zones."${domain}" = {
19 # DOC: https://docs.gandi.net/en/domain_names/advanced_users/secondary_nameserver.html
20 # DOC: https://www.sidn.nl/en/dnssec/dnssec-signatures-in-bind-named
21 provideXFR = [ "217.70.177.40 NOKEY" ];
22 # Not allowed by 217.70.177.40
23 #notify = [ "217.70.177.40 NOKEY" ];
25 # TODO: increase the TTL once things have settled down
30 ; SOA (Start Of Authority)
32 ${toString (toInt (serial domain) - 1581021859 + 2016043001)} ; Serial number
35 1000h ; Expire (1000h)
45 chomsky A ${chomskyIPv4}
46 mermet A ${mermetIPv4}
49 autoconfig CNAME mermet
57 submission CNAME mermet
60 ; SPF (Sender Policy Framework)
61 @ 3600 IN SPF "v=spf1 mx ip4:${mermetIPv4} -all"
62 @ 3600 IN TXT "v=spf1 mx ip4:${mermetIPv4} -all"
68 _git._tcp.git 18000 IN SRV 0 0 9418 git