1 { pkgs, lib, config, ... }:
4 inherit (builtins.extraBuiltins) pass git;
5 inherit (pkgs.lib) unlinesAttrs types;
6 inherit (config) networking;
7 inherit (config.services) nsd rspamd;
8 # Use the Git commit time of the ${domain}.nix file to set the serial number.
9 # WARNING: the ${domain}.nix must be committed into Git for this to work.
10 # WARNING: when dnssec=true, dnssec-signzone is used with -N date
11 # which will override the serial number in the SOA,
12 # used by slave nameservers decide whether they should update or not from the master nameserver.
13 serial = domain: toString (git ./. [ "log" "-1" "--format=%ct" "--" (domain + ".nix") ]);
14 mermetIPv4 = "80.67.180.129";
15 domain = "sourcephile.fr";
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 ${serial domain} ; Serial number
35 1000h ; Expire (1000h)
45 mermet A ${mermetIPv4}
46 autoconfig A ${mermetIPv4}
54 submission A ${mermetIPv4}
57 ; SPF (Sender Policy Framework)
58 @ 3600 IN SPF "v=spf1 mx ip4:${mermetIPv4} -all"
59 @ 3600 IN TXT "v=spf1 mx ip4:${mermetIPv4} -all"
65 _git._tcp.git 18000 IN SRV 0 0 9418 git