nixpkgs/pkgs/development/tools/snazy/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
1.2 KiB
Nix
Raw Normal View History

{ lib, rustPlatform, fetchFromGitHub, installShellFiles }:
2022-04-27 10:22:06 +00:00
rustPlatform.buildRustPackage rec {
pname = "snazy";
2022-10-08 02:16:22 +00:00
version = "0.50.0";
2022-04-27 10:22:06 +00:00
src = fetchFromGitHub {
owner = "chmouel";
repo = pname;
rev = version;
2022-10-08 02:16:22 +00:00
sha256 = "sha256-wSRIJF2XPJvzmxuGbuPYPFgn9Eap3vqHT1CM/oQy8vM=";
2022-04-27 10:22:06 +00:00
};
2022-10-08 02:16:22 +00:00
cargoSha256 = "sha256-IGZZEyy9IGqkpsbnOzLdBSFbinZ7jhH2LWub/+gP89E=";
2022-04-27 10:22:06 +00:00
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installShellCompletion --cmd snazy \
--bash <($out/bin/snazy --shell-completion bash) \
--fish <($out/bin/snazy --shell-completion fish) \
--zsh <($out/bin/snazy --shell-completion zsh)
'';
2022-04-27 10:22:06 +00:00
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/snazy --help
$out/bin/snazy --version | grep "snazy ${version}"
runHook postInstallCheck
'';
meta = with lib; {
homepage = "https://github.com/chmouel/snazy/";
changelog = "https://github.com/chmouel/snazy/releases/tag/v${version}";
description = "A snazzy json log viewer";
longDescription = ''
Snazy is a simple tool to parse json logs and output them in a nice format
with nice colors.
'';
license = licenses.asl20;
maintainers = with maintainers; [ figsoda jk ];
2022-04-27 10:22:06 +00:00
};
}