1
0
Fork 0

still enable rollback tool even for disabled restic instances

This commit is contained in:
ibizaman 2024-08-25 21:57:04 +02:00 committed by Pierre Penninckx
parent a753254c0e
commit e6c56891e1

View file

@ -6,7 +6,7 @@ let
shblib = pkgs.callPackage ../../lib {}; shblib = pkgs.callPackage ../../lib {};
instanceOptions = { instanceOptions = {
enable = lib.mkEnableOption "shb restic"; enable = lib.mkEnableOption "shb restic. A disabled instance will not backup data anymore but still provides the helper tool to introspect and rollback snapshots";
passphraseFile = lib.mkOption { passphraseFile = lib.mkOption {
description = "Encryption key for the backups."; description = "Encryption key for the backups.";
@ -175,7 +175,7 @@ in
mkSettings = name: instance: builtins.map (mkRepositorySettings name instance) instance.repositories; mkSettings = name: instance: builtins.map (mkRepositorySettings name instance) instance.repositories;
in in
lib.flatten (lib.attrsets.mapAttrsToList mkSettings enabledInstances); lib.flatten (lib.attrsets.mapAttrsToList mkSettings cfg.instances);
services.restic.backups = services.restic.backups =
let let
@ -271,7 +271,7 @@ in
''; '';
mkSettings = name: instance: builtins.map (mkResticBinary name instance) instance.repositories; mkSettings = name: instance: builtins.map (mkResticBinary name instance) instance.repositories;
in in
lib.flatten (lib.attrsets.mapAttrsToList mkSettings enabledInstances); lib.flatten (lib.attrsets.mapAttrsToList mkSettings cfg.instances);
} }
]); ]);
} }