This commit is contained in:
SebastianStork 2026-01-17 13:21:16 +01:00
parent 0d7164fe0a
commit 49c918f747
Signed by: SebastianStork
SSH key fingerprint: SHA256:tRrGdjYOwgHxpSc/wTOZQZEjxcb15P0tyXRsbAfd+2Q
13 changed files with 53 additions and 53 deletions

View file

@ -7,8 +7,7 @@
let
backupsWithRestoreCommand =
config.custom.services.restic.backups
|> lib.filterAttrs (_: value: value.enable)
|> lib.filterAttrs (_: value: value.restoreCommand.enable);
|> lib.filterAttrs (_: backup: backup.enable && backup.restoreCommand.enable);
in
{
options.custom.services.restic.backups = lib.mkOption {
@ -35,13 +34,13 @@ in
environment.systemPackages =
backupsWithRestoreCommand
|> lib.mapAttrsToList (
name: value:
name: backup:
pkgs.writeShellApplication {
name = "restic-restore-${name}";
text =
let
inherit (value) conflictingService;
inherit (value.restoreCommand) preRestore postRestore;
inherit (backup) conflictingService;
inherit (backup.restoreCommand) preRestore postRestore;
hasConflictingService = conflictingService != null;
in
''