diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 374c4d113b02..42e587658ff4 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -18845,6 +18845,11 @@ githubId = 939420; name = "Petros Angelatos"; }; + petrzjunior = { + github = "petrzjunior"; + githubId = 7000918; + name = "Petr Zahradnik"; + }; petterstorvik = { email = "petterstorvik@gmail.com"; github = "storvik"; diff --git a/pkgs/by-name/hl/hl-log-viewer/package.nix b/pkgs/by-name/hl/hl-log-viewer/package.nix new file mode 100644 index 000000000000..433ad08570cc --- /dev/null +++ b/pkgs/by-name/hl/hl-log-viewer/package.nix @@ -0,0 +1,51 @@ +{ + lib, + rustPlatform, + installShellFiles, + fetchFromGitHub, + nix-update-script, + versionCheckHook, +}: +rustPlatform.buildRustPackage (finalAttrs: { + pname = "hl-log-viewer"; + version = "0.30.3"; + + src = fetchFromGitHub { + owner = "pamburus"; + repo = "hl"; + tag = "v${finalAttrs.version}"; + hash = "sha256-18FzXUvpMHu3EfECgcslhReinMM6Oa1qdTKbbqFiv1w="; + }; + + cargoHash = "sha256-qx3NxWgCsCurU+TObQIvn1Xyn5IRP/iNem3s201MD4A="; + useFetchCargoVendor = true; + + nativeBuildInputs = [ installShellFiles ]; + + postInstall = '' + installShellCompletion --cmd hl \ + --bash <($out/bin/hl --shell-completions bash) \ + --fish <($out/bin/hl --shell-completions fish) \ + --zsh <($out/bin/hl --shell-completions zsh) + $out/bin/hl --man-page >hl.1 + installManPage hl.1 + ''; + + doInstallCheck = true; + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgram = "${placeholder "out"}/bin/hl"; + versionCheckProgramArg = "--version"; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "JSON and logfmt log converter to human readable representation"; + homepage = "https://github.com/pamburus/hl"; + changelog = "https://github.com/pamburus/hl/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.mit; + mainProgram = "hl"; + maintainers = with lib.maintainers; [ petrzjunior ]; + }; +})