diff options
-rw-r--r-- | pkgs/applications/networking/sync/rclone/default.nix | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/pkgs/applications/networking/sync/rclone/default.nix b/pkgs/applications/networking/sync/rclone/default.nix index 2f484467450c0..57925a3292d80 100644 --- a/pkgs/applications/networking/sync/rclone/default.nix +++ b/pkgs/applications/networking/sync/rclone/default.nix @@ -1,4 +1,4 @@ -{ stdenv, buildGoPackage, fetchFromGitHub, buildPackages }: +{ stdenv, buildGoPackage, fetchFromGitHub, buildPackages, installShellFiles }: buildGoPackage rec { pname = "rclone"; @@ -17,6 +17,8 @@ buildGoPackage rec { outputs = [ "bin" "out" "man" ]; + nativeBuildInputs = [ installShellFiles ]; + postInstall = let rcloneBin = @@ -25,10 +27,11 @@ buildGoPackage rec { 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 + installManPage $src/rclone.1 + for shell in bash zsh; do + ${rcloneBin}/bin/rclone genautocomplete $shell rclone.$shell + installShellCompletion rclone.$shell + done ''; meta = with stdenv.lib; { |