This commit is contained in:
Reid 2026-06-09 10:11:09 -07:00
parent cae0bdfc96
commit 25927190ce
Signed by: reidlab
GPG key ID: DAF5EAF6665839FD

View file

@ -6,13 +6,18 @@ let
in { in {
options.modules.hardware.networking = { options.modules.hardware.networking = {
enable = mkEnableOption "Enable NetworkManager, a daemon for configuring network interfaces"; enable = mkEnableOption "Enable NetworkManager, a daemon for configuring network interfaces";
avoidRouterDns = mkEnableOption {
default = config.modules.core.laptop;
description = "Avoid using the router's DNS servers, useful on guest networks";
};
powersave = mkEnableOption { powersave = mkEnableOption {
default = config.modules.core.laptop; default = config.modules.core.laptop;
description = "Enable power saving options over Wi-Fi"; description = "Enable power saving options over Wi-Fi";
}; };
}; };
config = mkIf cfg.enable { config = mkMerge [
(mkIf cfg.enable {
networking.networkmanager = { networking.networkmanager = {
enable = true; enable = true;
dns = "systemd-resolved"; dns = "systemd-resolved";
@ -29,5 +34,19 @@ in {
# default startup time is Slowww # default startup time is Slowww
systemd.services.NetworkManager-wait-online.enable = false; systemd.services.NetworkManager-wait-online.enable = false;
}; })
(mkIf cfg.avoidRouterDns {
services.resolved.settings.Resolve.Domains = [ "~." ];
networking.nameservers = [
"1.1.1.1#cloudflare-dns.com"
"8.8.8.8#dns.google"
"1.0.0.1#cloudflare-dns.com"
"8.8.4.4#dns.google"
"2606:4700:4700::1111#cloudflare-dns.com"
"2001:4860:4860::8888#dns.google"
"2606:4700:4700::1001#cloudflare-dns.com"
"2001:4860:4860::8844#dns.google"
];
})
];
} }