mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 23:11: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 =
|
text =
|
||||||
let
|
let
|
||||||
inherit (value) conflictingService;
|
inherit (value) conflictingService;
|
||||||
|
inherit (value.restoreCommand) preRestore postRestore;
|
||||||
hasconflictingService = conflictingService != null;
|
hasconflictingService = conflictingService != null;
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
${lib.optionalString hasconflictingService "systemctl stop ${conflictingService}"}
|
${lib.optionalString hasconflictingService "systemctl stop ${conflictingService}"}
|
||||||
${value.restoreCommand.preRestore}
|
${preRestore}
|
||||||
restic-${name} restore latest --target /
|
restic-${name} restore latest --target /
|
||||||
${value.restoreCommand.postRestore}
|
${postRestore}
|
||||||
${lib.optionalString hasconflictingService "systemctl start ${conflictingService}"}
|
${lib.optionalString hasconflictingService "systemctl start ${conflictingService}"}
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue