mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 14:01:34 +01:00
Refactor
This commit is contained in:
parent
0d7164fe0a
commit
49c918f747
13 changed files with 53 additions and 53 deletions
|
|
@ -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
|
||||
''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue