2021-04-05 15:23:46 +00:00
|
|
|
{ stdenv, lib, buildGoModule, fetchFromGitHub, makeWrapper, iproute2, nettools }:
|
2020-11-12 09:05:59 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "mackerel-agent";
|
2023-02-09 11:40:11 +00:00
|
|
|
version = "0.75.0";
|
2020-11-12 09:05:59 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mackerelio";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-02-09 11:40:11 +00:00
|
|
|
sha256 = "sha256-XwyBHCx3MngLItgCZfil5k/h6DfQTO+0LN3brldceXI=";
|
2020-11-12 09:05:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = lib.optionals (!stdenv.isDarwin) [ nettools ];
|
2021-04-05 15:23:46 +00:00
|
|
|
buildInputs = lib.optionals (!stdenv.isDarwin) [ iproute2 ];
|
2020-11-12 09:05:59 +00:00
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
vendorHash = "sha256-cSWyNGR1J2kk4XcaJXFEsMGx5OtyKyBoxY2FCa62x9c=";
|
2020-11-12 09:05:59 +00:00
|
|
|
|
|
|
|
subPackages = [ "." ];
|
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
ldflags = [
|
|
|
|
"-X=main.version=${version}"
|
|
|
|
"-X=main.gitcommit=v${version}"
|
|
|
|
];
|
2020-11-12 09:05:59 +00: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 ];
|
|
|
|
};
|
|
|
|
}
|