Merge pull request #179163 from cmm/network-setup-bindTo

nixos/network-interfaces-scripted: don't bindTo absent network-setup.service
This commit is contained in:
Artturi 2022-07-19 01:33:14 +03:00 committed by GitHub
commit 6dc4ee65f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,12 +85,14 @@ let
hasDefaultGatewaySet = (cfg.defaultGateway != null && cfg.defaultGateway.address != "")
|| (cfg.enableIPv6 && cfg.defaultGateway6 != null && cfg.defaultGateway6.address != "");
networkLocalCommands = {
needNetworkSetup = cfg.resolvconf.enable || cfg.defaultGateway != null || cfg.defaultGateway6 != null;
networkLocalCommands = lib.mkIf needNetworkSetup {
after = [ "network-setup.service" ];
bindsTo = [ "network-setup.service" ];
};
networkSetup = lib.mkIf (config.networking.resolvconf.enable || cfg.defaultGateway != null || cfg.defaultGateway6 != null)
networkSetup = lib.mkIf needNetworkSetup
{ description = "Networking Setup";
after = [ "network-pre.target" "systemd-udevd.service" "systemd-sysctl.service" ];