mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 13:10:33 +00:00
Merge pull request #35141 from abbradar/dhcpcd-order
dhcpcd service: fix service dependencies when default gateways are set
This commit is contained in:
commit
17952ee589
|
@ -156,11 +156,11 @@ in
|
|||
systemd.services.dhcpcd = let
|
||||
cfgN = config.networking;
|
||||
hasDefaultGatewaySet = (cfgN.defaultGateway != null && cfgN.defaultGateway.address != "")
|
||||
|| (cfgN.defaultGateway6 != null && cfgN.defaultGateway6.address != "");
|
||||
&& (!cfgN.enableIPv6 || (cfgN.defaultGateway6 != null && cfgN.defaultGateway6.address != ""));
|
||||
in
|
||||
{ description = "DHCP Client";
|
||||
|
||||
wantedBy = optional (!hasDefaultGatewaySet) "network-online.target";
|
||||
wantedBy = [ "multi-user.target" ] ++ optional (!hasDefaultGatewaySet) "network-online.target";
|
||||
after = [ "network.target" ];
|
||||
wants = [ "network.target" ];
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ let
|
|||
else optional (dev != null && dev != "lo" && !config.boot.isContainer) (subsystemDevice dev);
|
||||
|
||||
hasDefaultGatewaySet = (cfg.defaultGateway != null && cfg.defaultGateway.address != "")
|
||||
|| (cfg.defaultGateway6 != null && cfg.defaultGateway6.address != "");
|
||||
|| (cfg.enableIPv6 && cfg.defaultGateway6 != null && cfg.defaultGateway6.address != "");
|
||||
|
||||
networkLocalCommands = {
|
||||
after = [ "network-setup.service" ];
|
||||
|
|
Loading…
Reference in a new issue