3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/servers/monitoring/mackerel-agent/default.nix

41 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 14:17:19 +01:00
buildGoModule rec {
pname = "mackerel-agent";
2021-07-06 08:25:33 +01:00
version = "0.72.1";
2020-08-30 14:17:19 +01:00
src = fetchFromGitHub {
owner = "mackerelio";
repo = pname;
rev = "v${version}";
2021-07-06 08:25:33 +01:00
sha256 = "sha256-pUbZY+TjSZNOrmRarYVUDI0HoIUMY0LacdFSdqQ/7D4=";
2020-08-30 14:17:19 +01: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 14:17:19 +01:00
2021-07-06 08:25:33 +01:00
vendorSha256 = "sha256-trVfF4voye6CQ5WK78yBT86fgSUFyxaCtsZx6kXgYGE=";
2020-08-30 14:17:19 +01:00
subPackages = [ "." ];
2021-08-26 07:45:51 +01:00
ldflags = [
"-X=main.version=${version}"
"-X=main.gitcommit=v${version}"
];
2020-08-30 14:17:19 +01:00
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 ];
};
}