Merge pull request #224072 from helsinki-systems/fix/borg-compact

nixos/borgbackup: run compact after prune
This commit is contained in:
0x4A6F 2023-04-11 21:14:39 +02:00 committed by GitHub
commit 3196b965ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,6 +66,7 @@ let
${mkKeepArgs cfg} \
${optionalString (cfg.prune.prefix != null) "--glob-archives ${escapeShellArg "${cfg.prune.prefix}*"}"} \
$extraPruneArgs
borg compact $extraArgs $extraCompactArgs
${cfg.postPrune}
'');
@ -638,6 +639,15 @@ in {
example = "--save-space";
};
extraCompactArgs = mkOption {
type = types.str;
description = lib.mdDoc ''
Additional arguments for {command}`borg compact`.
Can also be set at runtime using `$extraCompactArgs`.
'';
default = "";
example = "--cleanup-commits";
};
};
}
));