hl-log-viewer: init at 0.30.3

This commit is contained in:
Petr Zahradnik
2025-01-19 21:37:51 +01:00
parent 875aa2ab4a
commit 5af070ed42
+51
View File
@@ -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 ];
};
})