diff --git a/pkgs/development/tools/tokio-console/default.nix b/pkgs/development/tools/tokio-console/default.nix index 7d65f382f957..c37bf85de975 100644 --- a/pkgs/development/tools/tokio-console/default.nix +++ b/pkgs/development/tools/tokio-console/default.nix @@ -1,5 +1,6 @@ { lib , fetchFromGitHub +, installShellFiles , rustPlatform , protobuf }: @@ -17,7 +18,10 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-86KQpRpYSCQs6SUeG0HV26b58x/QUyovoL+5fg8JCOI="; - nativeBuildInputs = [ protobuf ]; + nativeBuildInputs = [ + installShellFiles + protobuf + ]; # uses currently unstable tokio features RUSTFLAGS = "--cfg tokio_unstable"; @@ -29,6 +33,13 @@ rustPlatform.buildRustPackage rec { "--skip config::tests::toml_example_changed" ]; + postInstall = '' + installShellCompletion --cmd tokio-console \ + --bash <($out/bin/tokio-console --log-dir $(mktemp -d) gen-completion bash) \ + --fish <($out/bin/tokio-console --log-dir $(mktemp -d) gen-completion fish) \ + --zsh <($out/bin/tokio-console --log-dir $(mktemp -d) gen-completion zsh) + ''; + meta = with lib; { description = "A debugger for asynchronous Rust code"; homepage = "https://github.com/tokio-rs/console";