2021-03-14 17:05:16 +01:00
|
|
|
{ stdenv, lib, buildGoModule, fetchFromGitHub, makeWrapper, iproute2, nettools }:
|
2020-08-30 15:17:19 +02:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "mackerel-agent";
|
2022-03-18 23:38:23 +01:00
|
|
|
version = "0.72.9";
|
2020-08-30 15:17:19 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mackerelio";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-03-18 23:38:23 +01:00
|
|
|
sha256 = "sha256-+3a0FyVf5AB85gGGBI8/ssLBqj9Kp3w9DUNbSaAtXvA=";
|
2020-08-30 15:17:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
checkInputs = lib.optionals (!stdenv.isDarwin) [ nettools ];
|
2021-03-14 17:05:16 +01:00
|
|
|
buildInputs = lib.optionals (!stdenv.isDarwin) [ iproute2 ];
|
2020-08-30 15:17:19 +02:00
|
|
|
|
2022-02-18 17:04:26 +01:00
|
|
|
vendorSha256 = "sha256-4hdy+Yr9EoUjJ4+pJ2ZEPGlnq+4sx5JLm92eFFav6tU=";
|
2020-08-30 15:17:19 +02:00
|
|
|
|
|
|
|
subPackages = [ "." ];
|
|
|
|
|
2021-08-26 08:45:51 +02:00
|
|
|
ldflags = [
|
|
|
|
"-X=main.version=${version}"
|
|
|
|
"-X=main.gitcommit=v${version}"
|
|
|
|
];
|
2020-08-30 15:17:19 +02: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 ];
|
|
|
|
};
|
|
|
|
}
|