nixpkgs/pkgs/servers/monitoring/mackerel-agent/default.nix

42 lines
1 KiB
Nix
Raw Normal View History

2021-03-14 16:05:16 +00:00
{ stdenv, lib, buildGoModule, fetchFromGitHub, makeWrapper, iproute2, nettools }:
2020-08-30 13:17:19 +00:00
buildGoModule rec {
pname = "mackerel-agent";
2021-01-22 15:03:29 +00:00
version = "0.71.1";
2020-08-30 13:17:19 +00:00
src = fetchFromGitHub {
owner = "mackerelio";
repo = pname;
rev = "v${version}";
2021-01-22 15:03:29 +00:00
sha256 = "sha256-xEUIfmQX7I+I2wi53vc1JZYDweY9OAAUd2TZJ125+iw=";
2020-08-30 13:17:19 +00:00
};
nativeBuildInputs = [ makeWrapper ];
checkInputs = lib.optionals (!stdenv.isDarwin) [ nettools ];
2021-03-14 16:05:16 +00:00
buildInputs = lib.optionals (!stdenv.isDarwin) [ iproute2 ];
2020-08-30 13:17:19 +00:00
2021-01-22 15:03:29 +00:00
vendorSha256 = "sha256-yomxALecP+PycelOmwrteK/LoW7wsst7os+jcbF46Bs=";
2020-08-30 13:17:19 +00:00
subPackages = [ "." ];
buildFlagsArray = ''
-ldflags=
-X=main.version=${version}
-X=main.gitcommit=v${version}
'';
postInstall = ''
wrapProgram $out/bin/mackerel-agent \
--prefix PATH : "${lib.makeBinPath buildInputs}"
'';
doCheck = true;
meta = with lib; {
description = "System monitoring service for mackerel.io";
homepage = "https://github.com/mackerelio/mackerel-agent";
license = licenses.asl20;
maintainers = with maintainers; [ midchildan ];
};
}