depot/third_party/nixpkgs/pkgs/servers/monitoring/mackerel-agent/default.nix
Default email a3bb8d7922 Project import generated by Copybara.
GitOrigin-RevId: 439b1605227b8adb1357b55ce8529d541abbe9eb
2021-08-06 00:33:18 +03:00

41 lines
1 KiB
Nix

{ stdenv, lib, buildGoModule, fetchFromGitHub, makeWrapper, iproute2, nettools }:
buildGoModule rec {
pname = "mackerel-agent";
version = "0.72.1";
src = fetchFromGitHub {
owner = "mackerelio";
repo = pname;
rev = "v${version}";
sha256 = "sha256-pUbZY+TjSZNOrmRarYVUDI0HoIUMY0LacdFSdqQ/7D4=";
};
nativeBuildInputs = [ makeWrapper ];
checkInputs = lib.optionals (!stdenv.isDarwin) [ nettools ];
buildInputs = lib.optionals (!stdenv.isDarwin) [ iproute2 ];
vendorSha256 = "sha256-trVfF4voye6CQ5WK78yBT86fgSUFyxaCtsZx6kXgYGE=";
subPackages = [ "." ];
buildFlagsArray = ''
-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 ];
};
}