fs: fix raciness that was causing ensure-xyz services to run multiple times per boot

This commit is contained in:
Colin 2023-07-08 09:08:59 +00:00
parent f18d624fd9
commit e9293dbe07

View File

@ -191,11 +191,14 @@ let
in {
systemd.services."${serviceNameFor path}" = {
description = "prepare ${path}";
serviceConfig.Type = "oneshot";
serviceConfig.ExecStart = escapeShellArgs (
[ "${wrapperPath}" ] ++ wrapper.scriptArgs
);
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true; # makes `systemctl start ensure-blah` a noop if already completed, instead of a restart
ExecStart = escapeShellArgs (
[ "${wrapperPath}" ] ++ wrapper.scriptArgs
);
};
after = gen-opt.depends;
wants = gen-opt.depends;