diff options
author | Robert Schütz <robert.schuetz@stud.uni-heidelberg.de> | 2018-05-24 10:25:52 +0200 |
---|---|---|
committer | Robin Gloster <mail@glob.in> | 2018-05-24 13:53:25 +0200 |
commit | 3c0daa19e2d61d167325cbf558c15931bfd531b2 (patch) | |
tree | 1781d7fead0b593f68e4b84f4c3008043bcf7ca7 /nixos/modules/services/backup | |
parent | d32e2e30639eb23c027ccf9e6b0caaf33d58d00d (diff) | |
download | nixpkgs-3c0daa19e2d61d167325cbf558c15931bfd531b2.tar nixpkgs-3c0daa19e2d61d167325cbf558c15931bfd531b2.tar.gz nixpkgs-3c0daa19e2d61d167325cbf558c15931bfd531b2.tar.bz2 nixpkgs-3c0daa19e2d61d167325cbf558c15931bfd531b2.tar.lz nixpkgs-3c0daa19e2d61d167325cbf558c15931bfd531b2.tar.xz nixpkgs-3c0daa19e2d61d167325cbf558c15931bfd531b2.tar.zst nixpkgs-3c0daa19e2d61d167325cbf558c15931bfd531b2.zip |
nixos/borgbackup: make extraArgs a shell variable
in line with the other extra*Args variables
Diffstat (limited to 'nixos/modules/services/backup')
-rw-r--r-- | nixos/modules/services/backup/borgbackup.nix | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/nixos/modules/services/backup/borgbackup.nix b/nixos/modules/services/backup/borgbackup.nix index 1e019827dfe..0c3fc9af6f8 100644 --- a/nixos/modules/services/backup/borgbackup.nix +++ b/nixos/modules/services/backup/borgbackup.nix @@ -35,26 +35,26 @@ let ${cfg.preHook} '' + optionalString cfg.doInit '' # Run borg init if the repo doesn't exist yet - if ! borg list ${cfg.extraArgs} > /dev/null; then - borg init ${cfg.extraArgs} \ + if ! borg list $extraArgs > /dev/null; then + borg init $extraArgs \ --encryption ${cfg.encryption.mode} \ $extraInitArgs ${cfg.postInit} fi '' + '' - borg create ${cfg.extraArgs} \ + borg create $extraArgs \ --compression ${cfg.compression} \ --exclude-from ${mkExcludeFile cfg} \ $extraCreateArgs \ "::$archiveName$archiveSuffix" \ ${escapeShellArgs cfg.paths} '' + optionalString cfg.appendFailedSuffix '' - borg rename ${cfg.extraArgs} \ + borg rename $extraArgs \ "::$archiveName$archiveSuffix" "$archiveName" '' + '' ${cfg.postCreate} '' + optionalString (cfg.prune.keep != { }) '' - borg prune ${cfg.extraArgs} \ + borg prune $extraArgs \ ${mkKeepArgs cfg} \ --prefix ${escapeShellArg cfg.prune.prefix} \ $extraPruneArgs @@ -93,7 +93,7 @@ let }; environment = { BORG_REPO = cfg.repo; - inherit (cfg) extraInitArgs extraCreateArgs extraPruneArgs; + inherit (cfg) extraArgs extraInitArgs extraCreateArgs extraPruneArgs; } // (mkPassEnv cfg) // cfg.environment; inherit (cfg) startAt; }; @@ -463,7 +463,7 @@ in { service has. Handle with care. ''; default = ""; - example = "--remote-path=borg1"; + example = "--remote-path=/path/to/borg"; }; extraInitArgs = mkOption { |