1 { config, inputs, hostName, host, ... }:
3 domain = "i.sourcephile.fr";
5 gwIface = config.networking.defaultGateway.interface;
8 systemd.services.iodined.serviceConfig.LoadCredentialEncrypted = [
9 "password:${iodine/password.cred}"
11 systemd.sockets.iodined = {
13 listenDatagrams = [ "127.0.0.1:1053" ];
14 socketConfig.BindToDevice = "lo";
15 socketConfig.ReusePort = true;
16 wantedBy = [ "sockets.target" ];
18 services.iodine.server = {
21 passwordFile = "$CREDENTIALS_DIRECTORY/password";
23 extraConfig = "-4 -c -d ${dnsIface} -i 1800 -n ${host.ipv4}";
25 boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
26 networking.nftables.ruleset = ''
29 iifname ${dnsIface} udp dport domain counter accept comment "unbound: DNS"
32 iifname ${dnsIface} oifname ${gwIface} counter accept
33 iifname ${gwIface} oifname ${dnsIface} counter accept
38 iifname ${dnsIface} oifname ${gwIface} masquerade
42 services.unbound.settings.server = {
43 interface = [ "10.53.53.1" ];
44 access-control = [ "10.53.53.0/24 allow" ];