diff --git a/pkgs/applications/misc/kondo/default.nix b/pkgs/applications/misc/kondo/default.nix index eba5799a9172..03fc56ceb016 100644 --- a/pkgs/applications/misc/kondo/default.nix +++ b/pkgs/applications/misc/kondo/default.nix @@ -1,4 +1,4 @@ -{ lib, rustPlatform, fetchFromGitHub }: +{ lib, stdenv, rustPlatform, fetchFromGitHub, installShellFiles }: rustPlatform.buildRustPackage rec { pname = "kondo"; @@ -13,6 +13,15 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-WF4GHj/5VYrTUh1E3t29zbpSLjJ6g7RWVpLYqg9msZg="; + nativeBuildInputs = [ installShellFiles ]; + + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd kondo \ + --bash <($out/bin/kondo --completions bash) \ + --fish <($out/bin/kondo --completions fish) \ + --zsh <($out/bin/kondo --completions zsh) + ''; + meta = with lib; { description = "Save disk space by cleaning unneeded files from software projects"; homepage = "https://github.com/tbillington/kondo";