about summary refs log tree commit diff
path: root/pkgs/tools/backup/restic
diff options
context:
space:
mode:
authorImran Hossain <contact@imranhossa.in>2020-07-05 16:25:06 -0400
committerImran Hossain <contact@imranhossa.in>2020-07-05 16:25:06 -0400
commit56191821ea755a7e1cdd3985a89298d6ddfb8559 (patch)
treec514ff12f75eafbc15439f555873095963f41a07 /pkgs/tools/backup/restic
parent324c353ee3dff7f0d6050bc0043bad5cf74b20b3 (diff)
restic: Wrap binary with rclone
Diffstat (limited to 'pkgs/tools/backup/restic')
-rw-r--r--pkgs/tools/backup/restic/default.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/pkgs/tools/backup/restic/default.nix b/pkgs/tools/backup/restic/default.nix
index f366533f9bfaf..33cac4ad229b5 100644
--- a/pkgs/tools/backup/restic/default.nix
+++ b/pkgs/tools/backup/restic/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, lib, buildGoPackage, fetchFromGitHub, installShellFiles, nixosTests}:
+{ stdenv, lib, buildGoPackage, fetchFromGitHub, installShellFiles, makeWrapper
+, nixosTests, rclone }:
 
 buildGoPackage rec {
   pname = "restic";
@@ -15,11 +16,13 @@ buildGoPackage rec {
 
   subPackages = [ "cmd/restic" ];
 
-  nativeBuildInputs = [ installShellFiles ];
+  nativeBuildInputs = [ installShellFiles makeWrapper ];
 
   passthru.tests.restic = nixosTests.restic;
 
-  postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
+  postInstall = ''
+    wrapProgram $out/bin/restic --prefix PATH : '${rclone}/bin'
+  '' + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
     $out/bin/restic generate \
       --bash-completion restic.bash \
       --zsh-completion restic.zsh \