From 7e8e00d656a145a8c72aae94c7d244f25e8f3594 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Mon, 25 Jul 2022 11:53:01 -0300 Subject: [PATCH] nixos/restic: use postStop for `backupCleanupCommand` That way the `backupCleanupCommand` can also run when the backup service failed for some reason. Fixes: #182089. Signed-off-by: Otavio Salvador --- nixos/modules/services/backup/restic.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/backup/restic.nix b/nixos/modules/services/backup/restic.nix index 333fdd494e3b..a8e7a8b70dfa 100644 --- a/nixos/modules/services/backup/restic.nix +++ b/nixos/modules/services/backup/restic.nix @@ -312,7 +312,7 @@ in ''} ''; } // optionalAttrs (backup.dynamicFilesFrom != null || backup.backupCleanupCommand != null) { - postStart = '' + postStop = '' ${optionalString (backup.backupCleanupCommand != null) '' ${pkgs.writeScript "backupCleanupCommand" backup.backupCleanupCommand} ''}