about summary refs log tree commit diff
path: root/pkgs/development/tools/rye
diff options
context:
space:
mode:
authorsudosubin <sudosubin@gmail.com>2023-10-09 20:36:38 +0900
committersudosubin <sudosubin@gmail.com>2023-10-09 20:36:38 +0900
commit83a5c7e5480b531b67f109f3035f678d69a797dc (patch)
treeda72e32ac63155be1d8b4a1dd3ba37405941e49d /pkgs/development/tools/rye
parent6b78dbceb95404ab4e6b18629bbcc214ab8d823e (diff)
rye: add completion
Diffstat (limited to 'pkgs/development/tools/rye')
-rw-r--r--pkgs/development/tools/rye/default.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkgs/development/tools/rye/default.nix b/pkgs/development/tools/rye/default.nix
index fb5cc68d9e70a..409d7d1723cad 100644
--- a/pkgs/development/tools/rye/default.nix
+++ b/pkgs/development/tools/rye/default.nix
@@ -1,6 +1,7 @@
 { lib
 , rustPlatform
 , fetchFromGitHub
+, installShellFiles
 , pkg-config
 , openssl
 , stdenv
@@ -31,7 +32,7 @@ rustPlatform.buildRustPackage rec {
     OPENSSL_NO_VENDOR = 1;
   };
 
-  nativeBuildInputs = [ pkg-config ];
+  nativeBuildInputs = [ installShellFiles pkg-config ];
 
   buildInputs = [
     openssl
@@ -41,6 +42,13 @@ rustPlatform.buildRustPackage rec {
     SystemConfiguration
   ];
 
+  postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
+    installShellCompletion --cmd rye \
+      --bash <($out/bin/rye self completion -s bash) \
+      --fish <($out/bin/rye self completion -s fish) \
+      --zsh <($out/bin/rye self completion -s zsh)
+  '';
+
   checkFlags = [
     "--skip=utils::test_is_inside_git_work_tree"
   ];