about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/rye/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/tools/rye/default.nix')
-rw-r--r--nixpkgs/pkgs/development/tools/rye/default.nix14
1 files changed, 11 insertions, 3 deletions
diff --git a/nixpkgs/pkgs/development/tools/rye/default.nix b/nixpkgs/pkgs/development/tools/rye/default.nix
index 714a54cfa23e..409d7d1723ca 100644
--- a/nixpkgs/pkgs/development/tools/rye/default.nix
+++ b/nixpkgs/pkgs/development/tools/rye/default.nix
@@ -1,6 +1,7 @@
 { lib
 , rustPlatform
 , fetchFromGitHub
+, installShellFiles
 , pkg-config
 , openssl
 , stdenv
@@ -10,13 +11,13 @@
 
 rustPlatform.buildRustPackage rec {
   pname = "rye";
-  version = "0.13.0";
+  version = "0.15.2";
 
   src = fetchFromGitHub {
     owner = "mitsuhiko";
     repo = "rye";
     rev = "refs/tags/${version}";
-    hash = "sha256-B53oTAgy+y+FWk7y+unJPt7Mc7m4nwnTX+5wqL6AX+4=";
+    hash = "sha256-q7/obBE16aKb8BHf5ycXSgXTMLWAFwxSnJ3qV35TdL8=";
   };
 
   cargoLock = {
@@ -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"
   ];