summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configs/networkd.nix14
1 files changed, 13 insertions, 1 deletions
diff --git a/configs/networkd.nix b/configs/networkd.nix
index 9347237e..d9f93a0f 100644
--- a/configs/networkd.nix
+++ b/configs/networkd.nix
@@ -1,7 +1,19 @@
-{ lib, ... }: {
+{ config, lib, mylib, ... }: {
# often hangs
systemd.network.wait-online.enable = lib.mkDefault false;
networking.useNetworkd = true;
networking.useDHCP = false;
+
+ # Don't use DNS servers received from DHCP servers. The networks are
+ # called 40-NAME like the ones from
+ # <nixpkgs/nixos/modules/tasks/network-interfaces-systemd.nix>, so the
+ # settings merge into them.
+ systemd.network.networks =
+ mylib.genAttrs'
+ (builtins.attrNames config.networking.interfaces)
+ (name: lib.nameValuePair "40-${name}" {
+ dhcpV4Config.UseDNS = lib.mkDefault false;
+ dhcpV6Config.UseDNS = lib.mkDefault false;
+ });
}