prek: add shell completions (#484154)
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
rustPlatform,
|
||||
installShellFiles,
|
||||
git,
|
||||
uv,
|
||||
python312,
|
||||
@@ -22,6 +24,10 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
|
||||
cargoHash = "sha256-KOpQ3P9cmcWYT3bPKtKpzHPagX4b9hH0EiWGpt98NnE=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
];
|
||||
|
||||
nativeCheckInputs = [
|
||||
git
|
||||
python312
|
||||
@@ -180,6 +186,13 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
"version_info"
|
||||
];
|
||||
|
||||
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
installShellCompletion --cmd prek \
|
||||
--bash <(COMPLETE=bash $out/bin/prek) \
|
||||
--fish <(COMPLETE=fish $out/bin/prek) \
|
||||
--zsh <(COMPLETE=zsh $out/bin/prek)
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user