nixos/borgbackup: fix newline escaping with optional arguments

The newline must always be escaped, otherwise `extraPruneArgs` will be treated as a separate command if `prune.prefix` is unset.
This commit is contained in:
Naïm Favier 2022-12-10 16:46:34 +01:00 committed by GitHub
parent bbcfd192a8
commit 75e0609a00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,7 +58,7 @@ let
'' + optionalString (cfg.prune.keep != { }) ''
borg prune $extraArgs \
${mkKeepArgs cfg} \
${optionalString (cfg.prune.prefix != null) "--glob-archives ${escapeShellArg "${cfg.prune.prefix}*"} \\"}
${optionalString (cfg.prune.prefix != null) "--glob-archives ${escapeShellArg "${cfg.prune.prefix}*"}"} \
$extraPruneArgs
${cfg.postPrune}
'';