kubecm: installShellCompletion (#398508)

This commit is contained in:
Peder Bergebakken Sundt 2025-05-01 19:25:25 +02:00 committed by GitHub
commit ec9ef36645
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,6 +2,8 @@
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
stdenv,
}:
buildGoModule rec {
@ -22,13 +24,25 @@ buildGoModule rec {
"-X github.com/sunny0826/kubecm/version.Version=${version}"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd kubecm \
--bash <($out/bin/kubecm completion bash) \
--fish <($out/bin/kubecm completion fish) \
--zsh <($out/bin/kubecm completion zsh)
'';
doCheck = false;
meta = with lib; {
description = "Manage your kubeconfig more easily";
homepage = "https://github.com/sunny0826/kubecm/";
license = licenses.asl20;
maintainers = with maintainers; [ qjoly ];
maintainers = with maintainers; [
qjoly
sailord
];
mainProgram = "kubecm";
};
}