nixos/switch-to-configuration: add sysinit-reactivation.target

This commit is contained in:
nikstur
2023-11-25 21:31:09 +01:00
parent 8bc3b617dd
commit e6b66f08a5
6 changed files with 160 additions and 4 deletions

View File

@@ -569,6 +569,13 @@ in
unitConfig.X-StopOnReconfiguration = true;
};
# This target only exists so that services ordered before sysinit.target
# are restarted in the correct order, notably BEFORE the other services,
# when switching configurations.
systemd.targets.sysinit-reactivation = {
description = "Reactivate sysinit units";
};
systemd.units =
mapAttrs' (n: v: nameValuePair "${n}.path" (pathToUnit n v)) cfg.paths
// mapAttrs' (n: v: nameValuePair "${n}.service" (serviceToUnit n v)) cfg.services