nixos/dhcpcd: fix when ipv6 is disabled (#362568)

This commit is contained in:
Michele Guerini Rocco 2024-12-14 14:23:06 +01:00 committed by GitHub
commit 9bdcd51ed6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;