lol

nixos/borgbackup: make extraArgs a shell variable

in line with the other extra*Args variables

authored by

Robert Schütz and committed by
Robin Gloster
3c0daa19 d32e2e30

+7 -7
+7 -7
nixos/modules/services/backup/borgbackup.nix
··· 35 35 ${cfg.preHook} 36 36 '' + optionalString cfg.doInit '' 37 37 # Run borg init if the repo doesn't exist yet 38 - if ! borg list ${cfg.extraArgs} > /dev/null; then 39 - borg init ${cfg.extraArgs} \ 38 + if ! borg list $extraArgs > /dev/null; then 39 + borg init $extraArgs \ 40 40 --encryption ${cfg.encryption.mode} \ 41 41 $extraInitArgs 42 42 ${cfg.postInit} 43 43 fi 44 44 '' + '' 45 - borg create ${cfg.extraArgs} \ 45 + borg create $extraArgs \ 46 46 --compression ${cfg.compression} \ 47 47 --exclude-from ${mkExcludeFile cfg} \ 48 48 $extraCreateArgs \ 49 49 "::$archiveName$archiveSuffix" \ 50 50 ${escapeShellArgs cfg.paths} 51 51 '' + optionalString cfg.appendFailedSuffix '' 52 - borg rename ${cfg.extraArgs} \ 52 + borg rename $extraArgs \ 53 53 "::$archiveName$archiveSuffix" "$archiveName" 54 54 '' + '' 55 55 ${cfg.postCreate} 56 56 '' + optionalString (cfg.prune.keep != { }) '' 57 - borg prune ${cfg.extraArgs} \ 57 + borg prune $extraArgs \ 58 58 ${mkKeepArgs cfg} \ 59 59 --prefix ${escapeShellArg cfg.prune.prefix} \ 60 60 $extraPruneArgs ··· 93 93 }; 94 94 environment = { 95 95 BORG_REPO = cfg.repo; 96 - inherit (cfg) extraInitArgs extraCreateArgs extraPruneArgs; 96 + inherit (cfg) extraArgs extraInitArgs extraCreateArgs extraPruneArgs; 97 97 } // (mkPassEnv cfg) // cfg.environment; 98 98 inherit (cfg) startAt; 99 99 }; ··· 463 463 service has. Handle with care. 464 464 ''; 465 465 default = ""; 466 - example = "--remote-path=borg1"; 466 + example = "--remote-path=/path/to/borg"; 467 467 }; 468 468 469 469 extraInitArgs = mkOption {