diff --git a/nixos/modules/services/networking/ifstate.nix b/nixos/modules/services/networking/ifstate.nix index ef44463ba9cf..a1aeeda26b8c 100644 --- a/nixos/modules/services/networking/ifstate.nix +++ b/nixos/modules/services/networking/ifstate.nix @@ -87,12 +87,6 @@ let "network.target" ]; - # We wait for the udev events queue to empty in the *hope* that the - # devices needed here become available. This is terribly broken and - # essentially no better than a random sleep(). - # FIXME: use .device units dependecies instead. - serviceConfig.ExecStartPre = "-${lib.getExe' pkgs.systemd "udevadm"} settle --timeout=180"; - unitConfig = { # Avoid default dependencies like "basic.target", which prevents ifstate from starting before luks is unlocked. DefaultDependencies = "no"; @@ -193,6 +187,13 @@ in ExecStart = "${lib.getExe cfg.package} --config ${ config.environment.etc."ifstate/ifstate.yaml".source } apply"; + + # We wait for the udev events queue to empty in the *hope* that the + # devices needed here become available. This is terribly broken and + # essentially no better than a random sleep(). Same below for initrd. + # FIXME: use .device units dependecies instead. + ExecStartPre = "-${lib.getExe' config.systemd.package "udevadm"} settle --timeout=180"; + # because oneshot services do not have a timeout by default TimeoutStartSec = "2min"; }; @@ -294,6 +295,8 @@ in } apply"; # because oneshot services do not have a timeout by default TimeoutStartSec = "2min"; + # See comment on non-initrd service above + ExecStartPre = "-${lib.getExe' config.boot.initrd.systemd.package "udevadm"} settle --timeout=180"; }; }; };