depot/third_party/nixpkgs/pkgs/servers/monitoring/mackerel-agent/default.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

40 lines
1 KiB
Nix

{ stdenv, lib, buildGoModule, fetchFromGitHub, makeWrapper, iproute2, nettools }:
buildGoModule rec {
pname = "mackerel-agent";
version = "0.78.3";
src = fetchFromGitHub {
owner = "mackerelio";
repo = pname;
rev = "v${version}";
sha256 = "sha256-9PahaZlHtD4p3C8CvXF2ceNuSOqyApJaZWhFNffNlVA=";
};
nativeBuildInputs = [ makeWrapper ];
nativeCheckInputs = lib.optionals (!stdenv.isDarwin) [ nettools ];
buildInputs = lib.optionals (!stdenv.isDarwin) [ iproute2 ];
vendorHash = "sha256-lcK1rofTKPpEu/tK8XpS9EhOA30R/8J3o57YlU1/+0k=";
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";
homepage = "https://github.com/mackerelio/mackerel-agent";
license = licenses.asl20;
maintainers = with maintainers; [ midchildan ];
};
}