NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.38k stars 14.33k forks source link

borgbackup: extraCreateArgs (and other args) are broken #323262

Open necauqua opened 5 months ago

necauqua commented 5 months ago

Describe the bug

extraCreateArgs escapes the args, breaking them because they are not expanded by bash, being passed from systemd through an env var. Easier to understand with the repro:

Steps To Reproduce

Steps to reproduce the behavior:

  1. Set up a borgbackup job test with extraCreateArgs = [ "--exclude-caches" ]
  2. systemctl cat borgbackup-job-test will have a line Environment="extraCreateArgs='--exclude-caches'"
  3. systemctl start borgbackup-job-test will then fail with borg create: error: argument ARCHIVE: "'--exclude-caches'": No archive specified
  4. Manually setting extraCreateArgs correctly in the preHook works around the issue.

Expected behavior

It should work as expected, I assume the same issue applies to other extraArgs parameters.

Notify maintainers

@dotlambda