mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 18:41:34 +01:00
Run all restic backups as root
This commit is contained in:
parent
f5e59e0d12
commit
2e53bdb015
7 changed files with 11 additions and 43 deletions
|
|
@ -44,13 +44,11 @@ in
|
|||
hasDependentService = dependentService != null;
|
||||
in
|
||||
''
|
||||
${lib.optionalString hasDependentService "sudo systemctl stop ${dependentService}"}
|
||||
sudo --user=${value.user} bash -c "
|
||||
${value.restoreCommand.preRestore}
|
||||
restic-${name} restore latest --target /
|
||||
${value.restoreCommand.postRestore}
|
||||
"
|
||||
${lib.optionalString hasDependentService "sudo systemctl start ${dependentService}"}
|
||||
${lib.optionalString hasDependentService "systemctl stop ${dependentService}"}
|
||||
${value.restoreCommand.preRestore}
|
||||
restic-${name} restore latest --target /
|
||||
${value.restoreCommand.postRestore}
|
||||
${lib.optionalString hasDependentService "systemctl start ${dependentService}"}
|
||||
'';
|
||||
}
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue