depot/third_party/nixpkgs/pkgs/servers/monitoring/mackerel-agent/default.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

41 lines
1.1 KiB
Nix

{ stdenv, lib, buildGoModule, fetchFromGitHub, makeWrapper, iproute2, nettools }:
buildGoModule rec {
pname = "mackerel-agent";
version = "0.81.0";
src = fetchFromGitHub {
owner = "mackerelio";
repo = pname;
rev = "v${version}";
sha256 = "sha256-C0/l5dt5HpSgpTw1rlQXWOh4CfCI8D/tKPTGNt67M08=";
};
nativeBuildInputs = [ makeWrapper ];
nativeCheckInputs = lib.optionals (!stdenv.isDarwin) [ nettools ];
buildInputs = lib.optionals (!stdenv.isDarwin) [ iproute2 ];
vendorHash = "sha256-JIqQXS2iw3opeotpfqC16w7hdu+7XjxhIyVj2M+98ec=";
subPackages = [ "." ];
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";
mainProgram = "mackerel-agent";
homepage = "https://github.com/mackerelio/mackerel-agent";
license = licenses.asl20;
maintainers = with maintainers; [ midchildan ];
};
}