diff options
author | Mario Rodas <marsam@users.noreply.github.com> | 2020-03-05 09:58:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-05 09:58:34 -0500 |
commit | 93fd4b7f0074e1fa3b277b301bd7e0a08100b29a (patch) | |
tree | ebac5b44ead3074bd079188dbbf9c613cd1d22cc | |
parent | 0e5d4573d4b408ba13711f2e3a48e1f3f4e043dc (diff) | |
parent | 08dc02a07b52380008b33256ca6ef1a87df6bc08 (diff) |
Merge pull request #79062 from marsam/update-rclone
rclone: install completions
-rw-r--r-- | pkgs/applications/networking/sync/rclone/default.nix | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/pkgs/applications/networking/sync/rclone/default.nix b/pkgs/applications/networking/sync/rclone/default.nix index c40b1573e566..d6f37583abe5 100644 --- a/pkgs/applications/networking/sync/rclone/default.nix +++ b/pkgs/applications/networking/sync/rclone/default.nix @@ -1,4 +1,4 @@ -{ stdenv, buildGoPackage, fetchFromGitHub }: +{ stdenv, buildGoPackage, fetchFromGitHub, buildPackages }: buildGoPackage rec { pname = "rclone"; @@ -17,9 +17,19 @@ buildGoPackage rec { outputs = [ "bin" "out" "man" ]; - postInstall = '' - install -D -m644 $src/rclone.1 $man/share/man/man1/rclone.1 - ''; + postInstall = + let + rcloneBin = + if stdenv.buildPlatform == stdenv.hostPlatform + then "$bin" + else stdenv.lib.getBin buildPackages.rclone; + in + '' + install -D -m644 $src/rclone.1 $man/share/man/man1/rclone.1 + mkdir -p $bin/share/zsh/site-functions $bin/share/bash-completion/completions/ + ${rcloneBin}/bin/rclone genautocomplete zsh $bin/share/zsh/site-functions/_rclone + ${rcloneBin}/bin/rclone genautocomplete bash $bin/share/bash-completion/completions/rclone.bash + ''; meta = with stdenv.lib; { description = "Command line program to sync files and directories to and from major cloud storage"; |