mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
nixos/borgbackup: add extraArgs to wrapper script
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
committed by
Sefa Eyeoglu
parent
6c1a443d51
commit
719d6217ff
@@ -206,16 +206,17 @@ let
|
||||
original,
|
||||
name,
|
||||
set ? { },
|
||||
extraArgs ? null,
|
||||
}:
|
||||
pkgs.runCommand "${name}-wrapper"
|
||||
{
|
||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||
}
|
||||
|
||||
''
|
||||
makeWrapper "${original}" "$out/bin/${name}" \
|
||||
${lib.concatStringsSep " \\\n " (
|
||||
lib.mapAttrsToList (name: value: ''--set ${name} "${value}"'') set
|
||||
(lib.mapAttrsToList (name: value: ''--set ${name} "${value}"'') set)
|
||||
++ (lib.optional (extraArgs != null) ''--add-flags "${extraArgs}"'')
|
||||
)}
|
||||
'';
|
||||
|
||||
@@ -230,6 +231,7 @@ let
|
||||
}
|
||||
// (mkPassEnv cfg)
|
||||
// cfg.environment;
|
||||
extraArgs = cfg.extraArgs or null;
|
||||
});
|
||||
|
||||
# Paths listed in ReadWritePaths must exist before service is started
|
||||
@@ -778,6 +780,9 @@ in
|
||||
description = ''
|
||||
Additional arguments for all {command}`borg` calls the
|
||||
service has. Handle with care.
|
||||
|
||||
These extra arguments also get included in the wrapper
|
||||
script for this job.
|
||||
'';
|
||||
default = [ ];
|
||||
example = [ "--remote-path=/path/to/borg" ];
|
||||
|
||||
@@ -131,7 +131,8 @@ in
|
||||
repo = remoteRepo;
|
||||
encryption.mode = "none";
|
||||
startAt = [ ];
|
||||
environment.BORG_RSH = "ssh -oStrictHostKeyChecking=no -i /root/id_ed25519";
|
||||
# This uses extraArgs instead of BORG_RSH to test propagation of these args
|
||||
extraArgs = [ "--rsh=ssh -oStrictHostKeyChecking=no -i /root/id_ed25519" ];
|
||||
};
|
||||
|
||||
commandFail = {
|
||||
|
||||
Reference in New Issue
Block a user