mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 13:40:28 +03:00
nixos/restic: fix #264696 and add a regression test
Make sure that preStart and postStop are included in all cases when they are nonempty.
This commit is contained in:
parent
9ec80ed610
commit
536401e90a
2 changed files with 14 additions and 3 deletions
|
@ -345,7 +345,7 @@ in
|
|||
} // optionalAttrs (backup.environmentFile != null) {
|
||||
EnvironmentFile = backup.environmentFile;
|
||||
};
|
||||
} // optionalAttrs (backup.initialize || backup.dynamicFilesFrom != null || backup.backupPrepareCommand != null) {
|
||||
} // optionalAttrs (backup.initialize || doBackup || backup.backupPrepareCommand != null) {
|
||||
preStart = ''
|
||||
${optionalString (backup.backupPrepareCommand != null) ''
|
||||
${pkgs.writeScript "backupPrepareCommand" backup.backupPrepareCommand}
|
||||
|
@ -360,12 +360,12 @@ in
|
|||
${pkgs.writeScript "dynamicFilesFromScript" backup.dynamicFilesFrom} >> ${filesFromTmpFile}
|
||||
''}
|
||||
'';
|
||||
} // optionalAttrs (backup.dynamicFilesFrom != null || backup.backupCleanupCommand != null) {
|
||||
} // optionalAttrs (doBackup || backup.backupCleanupCommand != null) {
|
||||
postStop = ''
|
||||
${optionalString (backup.backupCleanupCommand != null) ''
|
||||
${pkgs.writeScript "backupCleanupCommand" backup.backupCleanupCommand}
|
||||
''}
|
||||
${optionalString (backup.dynamicFilesFrom != null) ''
|
||||
${optionalString doBackup ''
|
||||
rm ${filesFromTmpFile}
|
||||
''}
|
||||
'';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue