From b8afe11d836703c8d4fe91474baea1d7f4792b15 Mon Sep 17 00:00:00 2001 From: Peter Lehmann Date: Sat, 2 Nov 2024 19:47:58 +0100 Subject: [PATCH] trippy: generate shell completions --- pkgs/tools/networking/trippy/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/tools/networking/trippy/default.nix b/pkgs/tools/networking/trippy/default.nix index 22aa10cc84a2..2e4a39565228 100644 --- a/pkgs/tools/networking/trippy/default.nix +++ b/pkgs/tools/networking/trippy/default.nix @@ -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";