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