From 01332149d415ec33238dc9a2d321457ad231e270 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Sun, 30 Nov 2014 04:46:52 -0800 Subject: [PATCH] nixos/networkd: Fix dhcp being enabled when it should be disabled --- nixos/modules/tasks/network-interfaces-systemd.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/tasks/network-interfaces-systemd.nix b/nixos/modules/tasks/network-interfaces-systemd.nix index 997c18046737..ee3efbbc9ffd 100644 --- a/nixos/modules/tasks/network-interfaces-systemd.nix +++ b/nixos/modules/tasks/network-interfaces-systemd.nix @@ -18,7 +18,7 @@ let prefixLength = i.ipv6PrefixLength; }; - dhcpStr = useDHCP: if useDHCP then "both" else "none"; + dhcpStr = useDHCP: if useDHCP == true || useDHCP == null then "both" else "none"; slaves = concatLists (map (bond: bond.interfaces) (attrValues cfg.bonds)) @@ -77,7 +77,7 @@ in networks."40-${i.name}" = mkMerge [ (genericNetwork mkDefault) { name = mkDefault i.name; DHCP = mkForce (dhcpStr - (if i.useDHCP != null then i.useDHCP else interfaceIps i == [ ])); + (if i.useDHCP != null then i.useDHCP else cfg.useDHCP && interfaceIps i == [ ])); address = flip map (interfaceIps i) (ip: "${ip.address}/${toString ip.prefixLength}"); } ];