2023-06-28 15:19:17 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
}:
|
2022-04-27 10:22:06 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "snazy";
|
2023-09-18 14:43:22 +00:00
|
|
|
version = "0.52.1";
|
2022-04-27 10:22:06 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "chmouel";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-09-18 14:43:22 +00:00
|
|
|
hash = "sha256-OoUu42vRe4wPaunb2vJ9ITd0Q76pBI/yC8FI0J+J+ts=";
|
2022-04-27 10:22:06 +00:00
|
|
|
};
|
2022-10-09 01:08:39 +00:00
|
|
|
|
2023-09-18 14:43:22 +00:00
|
|
|
cargoHash = "sha256-gUeKZNSo/zJ4Nqy4Fpk5JuvFylGBlKJu+Nw9XWXVx0g=";
|
2022-04-27 10:22:06 +00:00
|
|
|
|
2022-10-09 01:08:39 +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; {
|
|
|
|
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.
|
|
|
|
'';
|
2023-06-28 15:19:17 +00:00
|
|
|
homepage = "https://github.com/chmouel/snazy/";
|
|
|
|
changelog = "https://github.com/chmouel/snazy/releases/tag/${src.rev}";
|
2022-04-27 10:22:06 +00:00
|
|
|
license = licenses.asl20;
|
2022-10-09 01:08:39 +00:00
|
|
|
maintainers = with maintainers; [ figsoda jk ];
|
2022-04-27 10:22:06 +00:00
|
|
|
};
|
|
|
|
}
|