mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-29 03:10:19 +00:00
nixos/restic: fix repository initialization checks (#560908)
This commit is contained in:
@@ -478,7 +478,14 @@ in
|
||||
${pkgs.writeScript "backupPrepareCommand" backup.backupPrepareCommand}
|
||||
''}
|
||||
${lib.optionalString backup.initialize ''
|
||||
${resticCmd} cat config > /dev/null || ${resticCmd} init
|
||||
${resticCmd} cat config --no-lock > /dev/null || {
|
||||
status=$?
|
||||
if [ "$status" -eq 10 ]; then
|
||||
${resticCmd} init
|
||||
else
|
||||
exit "$status"
|
||||
fi
|
||||
}
|
||||
''}
|
||||
${lib.optionalString (backup.paths != null && backup.paths != [ ]) ''
|
||||
cat ${pkgs.writeText "staticPaths" (lib.concatLines backup.paths)} >> ${filesFromTmpFile}
|
||||
|
||||
Reference in New Issue
Block a user