]> Git — Sourcephile - sourcephile-nix.git/blob - hosts/mermet/acme/sourcephile.fr.nix
julm-nix: update
[sourcephile-nix.git] / hosts / mermet / acme / sourcephile.fr.nix
1 { pkgs, lib, config, ... }:
2 let
3 domain = "sourcephile.fr";
4 inherit (config.users) users groups;
5 in
6 {
7 networking.nftables.ruleset = ''
8 # for lego to check DNS propagation on ns6.gandi.net
9 add rule inet filter fw2net ip daddr 217.70.177.40 tcp dport 53 skuid ${users.acme.name} counter accept comment "DNS gandi"
10 add rule inet filter fw2net ip daddr 217.70.177.40 udp dport 53 skuid ${users.acme.name} counter accept comment "DNS gandi"
11 add rule inet filter fw2net ip6 daddr 2001:4b98:d:1::40 tcp dport 53 skuid ${users.acme.name} counter accept comment "DNS gandi"
12 add rule inet filter fw2net ip6 daddr 2001:4b98:d:1::40 udp dport 53 skuid ${users.acme.name} counter accept comment "DNS gandi"
13 '';
14 systemd.services."acme-${domain}".after = [
15 "unbound.service"
16 ];
17 security.acme.certs."${domain}" = {
18 email = "root@${domain}";
19 extraDomainNames = [
20 "*.${domain}"
21 ];
22 group = groups."acme".name;
23 keyType = "rsa4096";
24 dnsProvider = "rfc2136";
25 credentialsFile = pkgs.writeText "credentials" ''
26 RFC2136_NAMESERVER=127.0.0.1:5353
27 RFC2136_PROPAGATION_TIMEOUT=1000
28 RFC2136_POLLING_INTERVAL=30
29 RFC2136_SEQUENCE_INTERVAL=30
30 RFC2136_DNS_TIMEOUT=1000
31 RFC2136_TTL=1
32 '';
33 };
34 }