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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

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";
2022-03-18 22:38:23 +00:00
version = "0.72.9";
2020-08-30 14:17:19 +01:00
src = fetchFromGitHub {
owner = "mackerelio";
repo = pname;
rev = "v${version}";
2022-03-18 22:38:23 +00:00
sha256 = "sha256-+3a0FyVf5AB85gGGBI8/ssLBqj9Kp3w9DUNbSaAtXvA=";
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
2022-02-18 16:04:26 +00:00
vendorSha256 = "sha256-4hdy+Yr9EoUjJ4+pJ2ZEPGlnq+4sx5JLm92eFFav6tU=";
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 ];
};
}