in
{
imports = [
+ knot/autogeree.net.nix
knot/sourcephile.fr.nix
];
options.services.knot = {
security.acme = {
acceptTerms = true;
};
+environment.systemPackages = [
+ pkgs.lego
+];
+users = {
+ groups = {
+ acme = {};
+ };
+};
systemd.services.knot.preStart = lib.concatStringsSep "\n" (lib.mapAttrsToList (domain: {data, ...}:
lib.optionalString (data != null) ''
install -D -o knot -g knot -m 700 ${pkgs.writeText "${domain}.zone" data} /var/lib/knot/zones/${domain}.zone
# https://www.knot-dns.cz/docs/2.6/html/reference.html
extraConfig = ''
server :
+ # Listen on localhost to allow only there
+ # dynamic updates for ACME challenges.
listen: 127.0.0.1@5353
mod-rrl:
- id: secondary_gandi
address: 217.70.177.40@53
+ - id: secondary_muarf
+ address: 78.192.65.63@53
+
submission:
- id: dnssec_validating_resolver
parent: local_resolver
ksk-submission: dnssec_validating_resolver
acl:
- - id: acl_localhost
- address: 127.0.0.1
- action: transfer
-
- - id: acl_lego
- address: 127.0.0.1
- action: update
-
# DOC: https://docs.gandi.net/en/domain_names/advanced_users/secondary_nameserver.html
- id: acl_gandi
address: 217.70.177.40
action: transfer
+ - id: acl_muarf
+ address: 78.192.65.63
+ action: transfer
+
'' + lib.concatStringsSep "\n" (lib.mapAttrsToList (domain: {conf, ...}: conf) knot.zones);
};
};