nixpkgs/pkgs/by-name/sn/snazy/package.nix

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

55 lines
1.4 KiB
Nix
Raw Normal View History

{
lib,
rustPlatform,
fetchFromGitHub,
installShellFiles,
stdenv,
}:
2022-04-27 10:22:06 +00:00
rustPlatform.buildRustPackage rec {
pname = "snazy";
2024-10-26 23:24:33 +00:00
version = "0.54.0";
2022-04-27 10:22:06 +00:00
src = fetchFromGitHub {
owner = "chmouel";
repo = pname;
rev = version;
2024-10-26 23:24:33 +00:00
hash = "sha256-1+UbUwvv5HWiQ+u9gPtJ3JwP6cMi4IZOCSMedXzWEoQ=";
2022-04-27 10:22:06 +00:00
};
2024-10-26 23:24:33 +00:00
cargoHash = "sha256-NmnKWVyD+NrP7ReERQB1/K8hyrSFj6qgjQjYwxZc+OY=";
2022-04-27 10:22:06 +00:00
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
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 = "Snazzy json log viewer";
mainProgram = "snazy";
2022-04-27 10:22:06 +00:00
longDescription = ''
Snazy is a simple tool to parse json logs and output them in a nice format
with nice colors.
'';
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;
maintainers = with maintainers; [
figsoda
jk
];
2022-04-27 10:22:06 +00:00
};
}