From 3c0daa19e2d61d167325cbf558c15931bfd531b2 Mon Sep 17 00:00:00 2001 From: Robert Schütz Date: Thu, 24 May 2018 10:25:52 +0200 Subject: nixos/borgbackup: make extraArgs a shell variable in line with the other extra*Args variables --- nixos/modules/services/backup/borgbackup.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'nixos/modules') diff --git a/nixos/modules/services/backup/borgbackup.nix b/nixos/modules/services/backup/borgbackup.nix index 1e019827dfea..0c3fc9af6f88 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 { -- cgit 1.4.1