Files
nixpkgs/pkgs/by-name/mt/mtail/package.nix
2026-09-15 08:33:43 +00:00

54 lines
1.1 KiB
Nix

{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
gotools,
}:
buildGoModule (finalAttrs: {
pname = "mtail";
version = "3.4.12";
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "jaqx0r";
repo = "mtail";
tag = "v${finalAttrs.version}";
hash = "sha256-RkevdYk8SVhyBgpCFhAXqA8TYQBG8azh2h0w2HhF/9Y=";
};
proxyVendor = true;
vendorHash = "sha256-jaioqP9J+HwxY1fdltZ769cqviSogztaKA1KMyV4cZ0=";
nativeBuildInputs = [
gotools # goyacc
];
ldflags = [
"-X=main.Branch=main"
"-X=main.Version=${finalAttrs.version}"
"-X=main.Revision=${finalAttrs.src.rev}"
];
# fails on darwin with: write unixgram -> <tmpdir>/rsyncd.log: write: message too long
doCheck = !stdenv.hostPlatform.isDarwin;
checkFlags = [
# can only be executed under bazel
"-skip=TestExecMtail"
];
preBuild = ''
GOOS= GOARCH= go generate ./...
'';
meta = {
description = "Tool for extracting metrics from application logs";
homepage = "https://github.com/jaqx0r/mtail";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ nickcao ];
mainProgram = "mtail";
};
})