Merge pull request #299167 from marsam/uv-completions

uv: install completions
This commit is contained in:
Mario Rodas 2024-03-26 08:33:31 -05:00 committed by GitHub
commit 3a66e16970
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,6 +2,7 @@
, cmake , cmake
, darwin , darwin
, fetchFromGitHub , fetchFromGitHub
, installShellFiles
, openssl , openssl
, pkg-config , pkg-config
, rustPlatform , rustPlatform
@ -30,6 +31,7 @@ rustPlatform.buildRustPackage rec {
nativeBuildInputs = [ nativeBuildInputs = [
cmake cmake
installShellFiles
pkg-config pkg-config
]; ];
@ -48,6 +50,14 @@ rustPlatform.buildRustPackage rec {
OPENSSL_NO_VENDOR = true; OPENSSL_NO_VENDOR = true;
}; };
postInstall = ''
export HOME=$TMPDIR
installShellCompletion --cmd uv \
--bash <($out/bin/uv --generate-shell-completion bash) \
--fish <($out/bin/uv --generate-shell-completion fish) \
--zsh <($out/bin/uv --generate-shell-completion zsh)
'';
passthru.updateScript = nix-update-script { }; passthru.updateScript = nix-update-script { };
meta = with lib; { meta = with lib; {