From 99994a67b167b7f698a974d1becfa55feabf9b0f Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Sun, 27 Nov 2022 23:35:12 +0100 Subject: [PATCH] Fix shutdown units --- hosts/droppie/restic-backup.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hosts/droppie/restic-backup.nix b/hosts/droppie/restic-backup.nix index d3732c21..c449366c 100644 --- a/hosts/droppie/restic-backup.nix +++ b/hosts/droppie/restic-backup.nix @@ -2,7 +2,7 @@ let shutdownWaitMinutes = 15; - shutdownScript = pkgs.writeScript "shutdown" '' + shutdownScript = pkgs.writeShellScriptBin "shutdown-wait" '' STATUS_FILES="/media/internal/backups-pub-solar/status" running="" @@ -37,7 +37,8 @@ in systemd.services."shutdown-after-backup" = { enable = true; serviceConfig = { - ExecStart = shutdownScript; + ExecStart = "${shutdownScript}/bin/shutdown-wait"; + Type = "oneshot"; }; }; @@ -47,5 +48,6 @@ in OnCalendar = "3..9:*"; }; wantedBy = [ "timers.target" ]; + partOf = [ "shutdown-after-backup.service" ]; }; }