Merge pull request #259619 from Majiir/fix-networkd-dhcp

nixos/network-interfaces-systemd: fix DHCP setting
This commit is contained in:
Maximilian Bosch
2023-10-14 20:47:36 +02:00
committed by GitHub
3 changed files with 14 additions and 10 deletions

View File

@@ -89,7 +89,7 @@ let
networks."40-${i.name}" = mkMerge [ (genericNetwork id) {
name = mkDefault i.name;
DHCP = mkForce (dhcpStr
(if i.useDHCP != null then i.useDHCP else false));
(if i.useDHCP != null then i.useDHCP else (config.networking.useDHCP && i.ipv4.addresses == [ ])));
address = forEach (interfaceIps i)
(ip: "${ip.address}/${toString ip.prefixLength}");
routes = forEach (interfaceRoutes i)