mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 21:01:34 +01:00
restic: Make better use of inherit
This commit is contained in:
parent
33c79eb8ff
commit
eff39a6ccd
1 changed files with 3 additions and 2 deletions
|
|
@ -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}"}
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue