Skip to content

Commit

Permalink
test: dns
Browse files Browse the repository at this point in the history
  • Loading branch information
jz8132543 committed Feb 25, 2024
1 parent 5ff5149 commit 067fd99
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
26 changes: 22 additions & 4 deletions nixos/modules/base/dns-client.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ in {
networking =
if cfg.enable
then {
nameservers = ["127.0.0.2" "127.0.0.55"];
# nameservers = ["127.0.0.2" "127.0.0.55"];
nameservers = ["127.0.0.55"];
# resolvconf.enable = lib.mkForce false;
dhcpcd.extraConfig = "nohook resolv.conf";
networkmanager.dns = lib.mkForce "none";
Expand Down Expand Up @@ -67,7 +68,24 @@ in {
};
};
};
# systemd.services.dnscrypt-proxy2.serviceConfig = {
# StateDirectory = "dnscrypt-proxy";
# };
# Add polkit rule to allow systemd-resolved to change DNS config
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if (subject.isInGroup("systemd-resolve") && (
action.id == "org.freedesktop.resolve1.register-service" ||
action.id == "org.freedesktop.resolve1.revert" ||
action.id == "org.freedesktop.resolve1.set-default-route" ||
action.id == "org.freedesktop.resolve1.set-dns-over-tls" ||
action.id == "org.freedesktop.resolve1.set-dns-servers" ||
action.id == "org.freedesktop.resolve1.set-dnssec" ||
action.id == "org.freedesktop.resolve1.set-dnssec-negative-trust-anchors" ||
action.id == "org.freedesktop.resolve1.set-domains" ||
action.id == "org.freedesktop.resolve1.set-llmnr" ||
action.id == "org.freedesktop.resolve1.set-mdns" ||
action.id == "org.freedesktop.resolve1.unregister-service"
)) {
return polkit.Result.YES;
}
});
'';
}
2 changes: 1 addition & 1 deletion nixos/modules/desktop/apps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
programs = {
clash-verge = {
enable = true;
# autoStart = true;
autoStart = true;
tunMode = true;
};
};
Expand Down
File renamed without changes.

0 comments on commit 067fd99

Please sign in to comment.