From eff39a6ccdf9b9441fe333d6b2c236ada31b414b Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Mon, 6 Oct 2025 21:45:04 +0200 Subject: [PATCH] restic: Make better use of `inherit` --- modules/system/services/restic-backups/restore.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/system/services/restic-backups/restore.nix b/modules/system/services/restic-backups/restore.nix index 14edaf9..e322b95 100644 --- a/modules/system/services/restic-backups/restore.nix +++ b/modules/system/services/restic-backups/restore.nix @@ -41,13 +41,14 @@ in text = let inherit (value) conflictingService; + inherit (value.restoreCommand) preRestore postRestore; hasconflictingService = conflictingService != null; in '' ${lib.optionalString hasconflictingService "systemctl stop ${conflictingService}"} - ${value.restoreCommand.preRestore} + ${preRestore} restic-${name} restore latest --target / - ${value.restoreCommand.postRestore} + ${postRestore} ${lib.optionalString hasconflictingService "systemctl start ${conflictingService}"} ''; }