pub-solar-os/profiles/misc/stubby.nix

36 lines
689 B
Nix
Raw Normal View History

2020-07-16 21:16:52 +00:00
{ pkgs, ... }: {
2019-12-16 09:34:29 +00:00
services.stubby = {
enable = true;
upstreamServers = ''
- address_data: 1.1.1.1
tls_port: 853
tls_auth_name: "cloudflare-dns.com"
- address_data: 1.0.0.1
tls_port: 853
tls_auth_name: "cloudflare-dns.com"
'';
};
environment.etc = {
"resolv.conf" = {
text = ''
options edns0
nameserver 127.0.0.1
'';
mode = "444";
};
};
2020-07-16 21:16:52 +00:00
system.activationScripts.immutableDns = {
text = ''
${pkgs.e2fsprogs}/bin/chattr +i /etc/resolv.conf
'';
deps = [ ];
};
2019-12-16 09:34:29 +00:00
networking = {
networkmanager.dns = "none";
resolvconf.dnsExtensionMechanism = false;
};
}