nixos: deploys do not kill a running backup or replica
Some checks failed
nixos / nixos (push) Failing after 1m15s

The daily replica that started at 06:09:59 was stopped 41 seconds later
by a deploy that changed its unit, and mailed a failure. Long one-shot
jobs keep running through a switch now; the next run uses the new unit.

Assisted-by: Claude:opus-5-5
This commit is contained in:
Sergei Poljanski 2026-11-17 10:21:13 +04:00
commit b8cbf0fbf5
Signed by: asxpi
GPG key ID: 4F8851660FA4121B
2 changed files with 4 additions and 0 deletions

View file

@ -54,6 +54,8 @@ in
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
onFailure = [ "alert-mail@%n.service" ];
# A deploy that changes this unit must not kill a running replica
restartIfChanged = false;
path = [ pkgs.rclone ];
# rclone looks for a home directory even when its remotes come from
# the environment

View file

@ -153,6 +153,8 @@ in
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
onFailure = [ "alert-mail@%n.service" ];
# A deploy that changes this unit must not kill a running backup
restartIfChanged = false;
serviceConfig = {
Type = "oneshot";
ExecStart = "${script}/bin/restic-backup run";