mirror of
https://git.gay/sneexy/nixos.git
synced 2026-01-11 05:03:15 -08:00
47 lines
1.6 KiB
Nix
47 lines
1.6 KiB
Nix
{
|
|
inputs,
|
|
outputs,
|
|
lib,
|
|
config,
|
|
pkgs,
|
|
...
|
|
}: {
|
|
# Enable networking
|
|
networking.networkmanager.enable = true;
|
|
|
|
# we're using/prioritizing dnscrypt!
|
|
networking.nameservers = ["127.0.0.1" "::1"];
|
|
# resolved and others conflicts with setting dns here
|
|
networking.resolvconf.enable = pkgs.lib.mkForce false;
|
|
networking.dhcpcd.extraConfig = "nohook resolv.conf";
|
|
services.resolved.enable = false;
|
|
# also ensuring that networkmanager doesn't modify dns settings
|
|
networking.networkmanager.dns = "none";
|
|
|
|
# dnscrypt settings
|
|
services.dnscrypt-proxy2 = {
|
|
enable = true;
|
|
settings = {
|
|
ipv6_servers = true;
|
|
require_dnssec = true;
|
|
|
|
sources.public-resolvers = {
|
|
# of course, sourcing from the main public lists
|
|
urls = [
|
|
"https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md"
|
|
"https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md"
|
|
];
|
|
cache_file = "/var/lib/dnscrypt-proxy2/public-resolvers.md";
|
|
minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
|
|
};
|
|
|
|
# You can choose a specific set of servers from https://github.com/DNSCrypt/dnscrypt-resolvers/blob/master/v3/public-resolvers.md
|
|
# prioritize quad9, then adguard, and cloudflare as last resort
|
|
server_names = ["quad9-dnscrypt-ip4-filter-pri" "quad9-doh-ip4-port443-filter-pri" "quad9-doh-ip6-port443-filter-pri" "adguard-dns-doh" "adguard-dns-ipv6" "cloudflare" "cloudflare-ipv6"];
|
|
};
|
|
};
|
|
|
|
systemd.services.dnscrypt-proxy2.serviceConfig = {
|
|
StateDirectory = "dnscrypt-proxy";
|
|
};
|
|
}
|