Skip to content

Commit ec9ef36

Browse files
authored
kubecm: installShellCompletion (#398508)
2 parents db22a69 + 6881918 commit ec9ef36

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

pkgs/by-name/ku/kubecm/package.nix

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
lib,
33
buildGoModule,
44
fetchFromGitHub,
5+
installShellFiles,
6+
stdenv,
57
}:
68

79
buildGoModule rec {
@@ -22,13 +24,25 @@ buildGoModule rec {
2224
"-X github.com/sunny0826/kubecm/version.Version=${version}"
2325
];
2426

27+
nativeBuildInputs = [ installShellFiles ];
28+
29+
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
30+
installShellCompletion --cmd kubecm \
31+
--bash <($out/bin/kubecm completion bash) \
32+
--fish <($out/bin/kubecm completion fish) \
33+
--zsh <($out/bin/kubecm completion zsh)
34+
'';
35+
2536
doCheck = false;
2637

2738
meta = with lib; {
2839
description = "Manage your kubeconfig more easily";
2940
homepage = "https://github.com/sunny0826/kubecm/";
3041
license = licenses.asl20;
31-
maintainers = with maintainers; [ qjoly ];
42+
maintainers = with maintainers; [
43+
qjoly
44+
sailord
45+
];
3246
mainProgram = "kubecm";
3347
};
3448
}

0 commit comments

Comments
 (0)