Skip to content

Commit b6aec13

Browse files
committed
korrect: Add shell completions
1 parent d30d816 commit b6aec13

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

@@ -19,6 +20,15 @@ rustPlatform.buildRustPackage (finalAttrs: {
1920

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

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

0 commit comments

Comments
 (0)