forked from mirrors/nixpkgs
1be3d412c0
`buildGoModule` and `buildGoPackage` by default inherit the `platforms` from go. That seems better than explicitly configuring `platforms.all`. There are also many packages that specify 'linux + darwin' - this is even suggested in the documentation. We might also want to update those, but let's do the noncontroversial change first.
42 lines
1 KiB
Nix
42 lines
1 KiB
Nix
{ stdenv, lib, buildGoModule, fetchFromGitHub, makeWrapper, iproute2, nettools }:
|
|
|
|
buildGoModule rec {
|
|
pname = "mackerel-agent";
|
|
version = "0.71.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "mackerelio";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "sha256-xEUIfmQX7I+I2wi53vc1JZYDweY9OAAUd2TZJ125+iw=";
|
|
};
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
checkInputs = lib.optionals (!stdenv.isDarwin) [ nettools ];
|
|
buildInputs = lib.optionals (!stdenv.isDarwin) [ iproute2 ];
|
|
|
|
vendorSha256 = "sha256-yomxALecP+PycelOmwrteK/LoW7wsst7os+jcbF46Bs=";
|
|
|
|
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 ];
|
|
};
|
|
}
|