summary refs log tree commit diff
path: root/pkgs/tools/misc
diff options
context:
space:
mode:
authorEvan Stoll <evanjsx@gmail.com>2020-01-12 15:53:58 -0500
committerEvan Stoll <evanjsx@gmail.com>2020-01-12 16:09:55 -0500
commit68a5f9f073f36669638aa0bcb43c8a1c76f57935 (patch)
treecfdbd8a4113f12c15c47fb44a1ef2c9b5a298a96 /pkgs/tools/misc
parent22674e9b4388cb79fd88a45cb739871d35ec8056 (diff)
downloadnixpkgs-68a5f9f073f36669638aa0bcb43c8a1c76f57935.tar
nixpkgs-68a5f9f073f36669638aa0bcb43c8a1c76f57935.tar.gz
nixpkgs-68a5f9f073f36669638aa0bcb43c8a1c76f57935.tar.bz2
nixpkgs-68a5f9f073f36669638aa0bcb43c8a1c76f57935.tar.lz
nixpkgs-68a5f9f073f36669638aa0bcb43c8a1c76f57935.tar.xz
nixpkgs-68a5f9f073f36669638aa0bcb43c8a1c76f57935.tar.zst
nixpkgs-68a5f9f073f36669638aa0bcb43c8a1c76f57935.zip
broot: install newly-added shell completions
- add installShellFiles dependency
Diffstat (limited to 'pkgs/tools/misc')
-rw-r--r--pkgs/tools/misc/broot/default.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/pkgs/tools/misc/broot/default.nix b/pkgs/tools/misc/broot/default.nix
index 1391ae5fee5..b057b6b96aa 100644
--- a/pkgs/tools/misc/broot/default.nix
+++ b/pkgs/tools/misc/broot/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, rustPlatform, fetchFromGitHub, coreutils }:
+{ stdenv, rustPlatform, fetchFromGitHub, coreutils, installShellFiles }:
 
 rustPlatform.buildRustPackage rec {
   pname = "broot";
@@ -13,10 +13,21 @@ rustPlatform.buildRustPackage rec {
 
   cargoSha256 = "09gnyj97akychin1axp9kcww3c04xx7x1qnplhs2yxfki62r4y2b";
 
+  nativeBuildInputs = [ installShellFiles ];
+
   postPatch = ''
     substituteInPlace src/verb_store.rs --replace '"/bin/' '"${coreutils}/bin/'
   '';
 
+  postInstall = ''
+    # install shell completion files
+    OUT_DIR=target/release/build/broot-*/out
+
+    installShellCompletion --bash $OUT_DIR/{br,broot}.bash
+    installShellCompletion --fish $OUT_DIR/{br,broot}.fish
+    installShellCompletion --zsh $OUT_DIR/{_br,_broot}
+  '';
+
   meta = with stdenv.lib; {
     description = "An interactive tree view, a fuzzy search, a balanced BFS descent and customizable commands";
     homepage = "https://dystroy.org/broot/";