diff --git a/pkgs/by-name/ka/kaf/package.nix b/pkgs/by-name/ka/kaf/package.nix index 34a542b8ac3a..65fec0f2e434 100644 --- a/pkgs/by-name/ka/kaf/package.nix +++ b/pkgs/by-name/ka/kaf/package.nix @@ -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";