about summary refs log tree commit diff
path: root/pkgs/tools/text/repgrep/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/text/repgrep/default.nix')
-rw-r--r--pkgs/tools/text/repgrep/default.nix14
1 files changed, 10 insertions, 4 deletions
diff --git a/pkgs/tools/text/repgrep/default.nix b/pkgs/tools/text/repgrep/default.nix
index cefc0fba03494..607aa230569b3 100644
--- a/pkgs/tools/text/repgrep/default.nix
+++ b/pkgs/tools/text/repgrep/default.nix
@@ -1,4 +1,5 @@
 { lib
+, stdenv
 , rustPlatform
 , fetchFromGitHub
 , asciidoctor
@@ -9,16 +10,16 @@
 
 rustPlatform.buildRustPackage rec {
   pname = "repgrep";
-  version = "0.14.3";
+  version = "0.15.0";
 
   src = fetchFromGitHub {
     owner = "acheronfail";
     repo = "repgrep";
     rev = version;
-    hash = "sha256-33b0dZJY/lnVJGMfAg/faD6PPJIFZsvMZOmKAqCZw8k=";
+    hash = "sha256-6ba7EJUts0Ni9EA3ENlK+a2FaPo7JohtCyqwR9DdL1E=";
   };
 
-  cargoHash = "sha256-UMMTdWJ0/M8lN4abTJEVUGtoNp/g49DyW+OASg3TKfg=";
+  cargoHash = "sha256-XEjKTZ3qaiLWbm2wF+V97u9tGXDq/oTm249ubUE9n94=";
 
   nativeBuildInputs = [
     asciidoctor
@@ -32,8 +33,13 @@ rustPlatform.buildRustPackage rec {
 
     pushd "$(dirname "$(find -path '**/repgrep-stamp' | head -n 1)")"
     installManPage rgr.1
-    installShellCompletion rgr.{bash,fish} _rgr
     popd
+  '' + lib.optionalString (stdenv.hostPlatform.canExecute stdenv.buildPlatform) ''
+    # As it can be seen here: https://github.com/acheronfail/repgrep/blob/0.15.0/.github/workflows/release.yml#L206, the completions are just the same as ripgrep
+    installShellCompletion --cmd rgr \
+      --bash <(${lib.getExe ripgrep} --generate complete-bash | sed 's/-c rg/-c rgr/') \
+      --zsh <(${lib.getExe ripgrep} --generate complete-zsh | sed 's/-c rg/-c rgr/') \
+      --fish <(${lib.getExe ripgrep} --generate complete-fish | sed 's/-c rg/-c rgr/')
   '';
 
   meta = with lib; {