Skip to content

Commit 5d0717b

Browse files
committed
korrect: Add shell completions
1 parent 7711284 commit 5d0717b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkgs/by-name/ko/korrect/package.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
stdenv,
44
fetchCrate,
55
rustPlatform,
6+
installShellFiles,
67
nix-update-script,
78
}:
89

@@ -18,6 +19,15 @@ rustPlatform.buildRustPackage (finalAttrs: {
1819

1920
passthru.updateScript = nix-update-script { };
2021

22+
nativeBuildInputs = [ installShellFiles ];
23+
24+
postInstall = ''
25+
installShellCompletion --cmd ${finalAttrs.pname} \
26+
--bash <($out/bin/${finalAttrs.pname} completions bash) \
27+
--fish <($out/bin/${finalAttrs.pname} completions fish) \
28+
--zsh <($out/bin/${finalAttrs.pname} completions zsh)
29+
'';
30+
2131
meta = {
2232
description = "Kubectl version managing shim that invokes the correct kubectl version";
2333
homepage = "https://gitlab.com/cromulentbanana/korrect";

0 commit comments

Comments
 (0)