lol
1{ lib, rustPlatform, fetchFromGitHub, installShellFiles }:
2
3rustPlatform.buildRustPackage rec {
4 pname = "snazy";
5 version = "0.50.0";
6
7 src = fetchFromGitHub {
8 owner = "chmouel";
9 repo = pname;
10 rev = version;
11 sha256 = "sha256-wSRIJF2XPJvzmxuGbuPYPFgn9Eap3vqHT1CM/oQy8vM=";
12 };
13
14 cargoSha256 = "sha256-IGZZEyy9IGqkpsbnOzLdBSFbinZ7jhH2LWub/+gP89E=";
15
16 nativeBuildInputs = [ installShellFiles ];
17
18 postInstall = ''
19 installShellCompletion --cmd snazy \
20 --bash <($out/bin/snazy --shell-completion bash) \
21 --fish <($out/bin/snazy --shell-completion fish) \
22 --zsh <($out/bin/snazy --shell-completion zsh)
23 '';
24
25 doInstallCheck = true;
26 installCheckPhase = ''
27 runHook preInstallCheck
28 $out/bin/snazy --help
29 $out/bin/snazy --version | grep "snazy ${version}"
30 runHook postInstallCheck
31 '';
32
33 meta = with lib; {
34 homepage = "https://github.com/chmouel/snazy/";
35 changelog = "https://github.com/chmouel/snazy/releases/tag/v${version}";
36 description = "A snazzy json log viewer";
37 longDescription = ''
38 Snazy is a simple tool to parse json logs and output them in a nice format
39 with nice colors.
40 '';
41 license = licenses.asl20;
42 maintainers = with maintainers; [ figsoda jk ];
43 };
44}