users/systemd: fix so oneshot services arent stopped immediately after activation

This commit is contained in:
2024-10-18 02:55:44 +00:00
parent bc8e0d07f4
commit d138cec9fc

View File

@@ -94,10 +94,12 @@ let
})
(lib.mkIf (startCommand != null) {
serviceConfig.Type = "oneshot";
serviceConfig.RemainAfterExit = true;
serviceConfig.ExecStart = startCommand;
})
(lib.mkIf (cleanupCommand != null) {
serviceConfig.ExecStopPost = cleanupCommand;
serviceConfig.TimeoutStopSec = "30s"; #< system-wide default is closer to 10s, but eg25-control-powered takes longer than that
})
];