kaf: add shell completions

This commit is contained in:
Haseeb Majid
2025-11-19 17:40:39 +08:00
committed by aleksana
parent fe33ee713c
commit 0dd1faf8e1
+11
View File
@@ -2,6 +2,8 @@
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
stdenv,
}:
buildGoModule rec {
@@ -17,9 +19,18 @@ buildGoModule rec {
vendorHash = "sha256-1QcQeeYQFsStK27NVdyCAb1Y40lyifBf0dlSgzocG3Y=";
nativeBuildInputs = [ installShellFiles ];
# Many tests require a running Kafka instance
doCheck = false;
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd kaf \
--bash <($out/bin/kaf completion bash) \
--zsh <($out/bin/kaf completion zsh) \
--fish <($out/bin/kaf completion fish)
'';
meta = with lib; {
description = "Modern CLI for Apache Kafka, written in Go";
mainProgram = "kaf";