mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/networkd: Fix dhcp being enabled when it should be disabled
This commit is contained in:
parent
5b8fb2239c
commit
01332149d4
1 changed files with 2 additions and 2 deletions
|
@ -18,7 +18,7 @@ let
|
||||||
prefixLength = i.ipv6PrefixLength;
|
prefixLength = i.ipv6PrefixLength;
|
||||||
};
|
};
|
||||||
|
|
||||||
dhcpStr = useDHCP: if useDHCP then "both" else "none";
|
dhcpStr = useDHCP: if useDHCP == true || useDHCP == null then "both" else "none";
|
||||||
|
|
||||||
slaves =
|
slaves =
|
||||||
concatLists (map (bond: bond.interfaces) (attrValues cfg.bonds))
|
concatLists (map (bond: bond.interfaces) (attrValues cfg.bonds))
|
||||||
|
@ -77,7 +77,7 @@ in
|
||||||
networks."40-${i.name}" = mkMerge [ (genericNetwork mkDefault) {
|
networks."40-${i.name}" = mkMerge [ (genericNetwork mkDefault) {
|
||||||
name = mkDefault i.name;
|
name = mkDefault i.name;
|
||||||
DHCP = mkForce (dhcpStr
|
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)
|
address = flip map (interfaceIps i)
|
||||||
(ip: "${ip.address}/${toString ip.prefixLength}");
|
(ip: "${ip.address}/${toString ip.prefixLength}");
|
||||||
} ];
|
} ];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue