From 036d7e31f9d6012fc75afdabf70515a511723991 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Fri, 29 Dec 2023 16:52:02 -0500 Subject: [PATCH] mtail: build all binaries, enable tests --- pkgs/servers/monitoring/mtail/default.nix | 27 +++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/pkgs/servers/monitoring/mtail/default.nix b/pkgs/servers/monitoring/mtail/default.nix index 3aa5aa341550..ce61bb186caa 100644 --- a/pkgs/servers/monitoring/mtail/default.nix +++ b/pkgs/servers/monitoring/mtail/default.nix @@ -1,4 +1,8 @@ -{ lib, fetchFromGitHub, buildGoModule }: +{ lib +, stdenv +, buildGoModule +, fetchFromGitHub +}: buildGoModule rec { pname = "mtail"; @@ -13,21 +17,20 @@ buildGoModule rec { vendorHash = "sha256-KD75KHXrXXm5FMXeFInNTDsVsclyqTfsfQiB3Br+F1A="; - doCheck = false; - - subPackages = [ "cmd/mtail" ]; - - preBuild = '' - go generate -x ./internal/vm/ - ''; - ldflags = [ - "-X main.Version=${version}" + "-X=main.Branch=main" + "-X=main.Version=${version}" + "-X=main.Revision=${src.rev}" ]; + # fails on darwin with: write unixgram -> /rsyncd.log: write: message too long + doCheck = !stdenv.isDarwin; + meta = with lib; { - license = licenses.asl20; - homepage = "https://github.com/google/mtail"; description = "Tool for extracting metrics from application logs"; + homepage = "https://github.com/google/mtail"; + license = licenses.asl20; + maintainers = with maintainers; [ nickcao ]; + mainProgram = "mtail"; }; }