2 let inherit (config) users; in
6 networkmanager.dns = mkForce "none";
7 nameservers = [ "127.0.0.1" "::1" ];
8 #resolvconf.enable = lib.mkForce false;
9 resolvconf.useLocalResolver = true;
10 dhcpcd.extraConfig = "nohook resolv.conf";
12 services.resolved.enable = false;
14 # Create a user for matching egress on it in the firewall
15 systemd.services.dnscrypt-proxy2.serviceConfig.User = "dnscrypt-proxy2";
16 users.users.dnscrypt-proxy2 = {
18 group = "dnscrypt-proxy2";
20 users.groups.dnscrypt-proxy2 = { };
21 services.dnscrypt-proxy2 = {
23 # https://github.com/DNSCrypt/dnscrypt-proxy/blob/master/dnscrypt-proxy/example-dnscrypt-proxy.toml
24 upstreamDefaults = true;
27 disabled_server_names = [
30 dnscrypt_servers = true;
32 fallback_resolvers = [
37 ignore_system_dns = true;
41 #proxy = "socks5://127.0.0.1:9050";
43 netprobe_timeout = 60;
49 require_dnssec = true;
50 require_nofilter = true;
52 sources.public-resolvers = {
54 "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md"
55 "https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md"
57 cache_file = "/var/lib/dnscrypt-proxy/public-resolvers.md";
58 minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
64 networking.nftables.ruleset = ''
67 meta l4proto { udp, tcp } th dport domain skuid ${users.users.dnscrypt-proxy2.name} counter accept comment "DHCP"