trippy: generate shell completions (#353196)

This commit is contained in:
Sandro 2024-11-04 11:33:09 +01:00 committed by GitHub
commit 47fb89c27c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,8 @@
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, installShellFiles
}:
rustPlatform.buildRustPackage rec {
@ -14,8 +16,18 @@ rustPlatform.buildRustPackage rec {
hash = "sha256-ArSIeu3u+TUy18rzJvhq0+/qvi5xPZmtQ7rPpwaEx9g=";
};
nativeBuildInputs = [ installShellFiles ];
cargoHash = "sha256-h1NQQFjtlpQuyTz7AHuAPUe1GxR0Q2yKzow8XB9375U=";
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
local INSTALL="$out/bin/trip"
installShellCompletion --cmd trip \
--bash <($out/bin/trip --generate bash) \
--fish <($out/bin/trip --generate fish) \
--zsh <($out/bin/trip --generate zsh)
'';
meta = with lib; {
description = "Network diagnostic tool";
homepage = "https://trippy.cli.rs";