From 70e0c91fd60a97bb0109e22caa7a670eaa062e46 Mon Sep 17 00:00:00 2001 From: Sebastian Zivota Date: Mon, 8 Jan 2024 12:00:58 +0100 Subject: [PATCH] sentry-cli: Enable shell completions --- pkgs/development/tools/sentry-cli/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/sentry-cli/default.nix b/pkgs/development/tools/sentry-cli/default.nix index 242fc6b7329c..0bf5d3b0d2d8 100644 --- a/pkgs/development/tools/sentry-cli/default.nix +++ b/pkgs/development/tools/sentry-cli/default.nix @@ -1,6 +1,7 @@ { rustPlatform , fetchFromGitHub , lib +, installShellFiles , openssl , pkg-config , stdenv @@ -24,10 +25,17 @@ rustPlatform.buildRustPackage rec { OPENSSL_NO_VENDOR = 1; buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ CoreServices Security SystemConfiguration ]; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ installShellFiles pkg-config ]; cargoHash = "sha256-KytXqILji1pbiMz7OX+O5B2bw5MMlKf/MYh13+nd+bg="; + postInstall = '' + installShellCompletion --cmd sentry-cli \ + --bash <($out/bin/sentry-cli completions bash) \ + --fish <($out/bin/sentry-cli completions fish) \ + --zsh <($out/bin/sentry-cli completions zsh) + ''; + meta = with lib; { homepage = "https://docs.sentry.io/cli/"; license = licenses.bsd3;