dns
This commit is contained in:
parent
cae0bdfc96
commit
2097a145ab
1 changed files with 34 additions and 15 deletions
|
|
@ -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 {
|
||||||
|
servers.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"
|
||||||
|
];
|
||||||
|
})
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue