From ebbdb619354b4cf23ddddb0410b311a38faf702e Mon Sep 17 00:00:00 2001 From: Aaron Ecay Date: Fri, 6 Dec 2024 20:47:15 +0000 Subject: [PATCH] fix dhcpcd when ipv6 is disabled --- nixos/modules/services/networking/dhcpcd.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/dhcpcd.nix b/nixos/modules/services/networking/dhcpcd.nix index 059dc59e8a0a..310a1f3d1c55 100644 --- a/nixos/modules/services/networking/dhcpcd.nix +++ b/nixos/modules/services/networking/dhcpcd.nix @@ -249,7 +249,8 @@ in ExecReload = "${dhcpcd}/sbin/dhcpcd --rebind"; Restart = "always"; AmbientCapabilities = [ "CAP_NET_ADMIN" "CAP_NET_RAW" "CAP_NET_BIND_SERVICE" ]; - ReadWritePaths = [ "/proc/sys/net/ipv4" "/proc/sys/net/ipv6" ] + ReadWritePaths = [ "/proc/sys/net/ipv4" ] + ++ lib.optional cfgN.enableIPv6 "/proc/sys/net/ipv6" ++ lib.optionals useResolvConf ([ "/run/resolvconf" ] ++ config.networking.resolvconf.subscriberFiles); DeviceAllow = ""; LockPersonality = true;