restic: Wrap binary with rclone

This commit is contained in:
Imran Hossain 2020-07-05 16:25:06 -04:00
parent 324c353ee3
commit 56191821ea

View file

@ -1,4 +1,5 @@
{ stdenv, lib, buildGoPackage, fetchFromGitHub, installShellFiles, nixosTests}: { stdenv, lib, buildGoPackage, fetchFromGitHub, installShellFiles, makeWrapper
, nixosTests, rclone }:
buildGoPackage rec { buildGoPackage rec {
pname = "restic"; pname = "restic";
@ -15,11 +16,13 @@ buildGoPackage rec {
subPackages = [ "cmd/restic" ]; subPackages = [ "cmd/restic" ];
nativeBuildInputs = [ installShellFiles ]; nativeBuildInputs = [ installShellFiles makeWrapper ];
passthru.tests.restic = nixosTests.restic; 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 \ $out/bin/restic generate \
--bash-completion restic.bash \ --bash-completion restic.bash \
--zsh-completion restic.zsh \ --zsh-completion restic.zsh \