1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-21 13:44:50 +00:00
nixpkgs/pkgs/servers/monitoring/mackerel-agent/default.nix
2021-11-03 12:57:42 +00:00

41 lines
1 KiB
Nix

{ stdenv, lib, buildGoModule, fetchFromGitHub, makeWrapper, iproute2, nettools }:
buildGoModule rec {
pname = "mackerel-agent";
version = "0.72.3";
src = fetchFromGitHub {
owner = "mackerelio";
repo = pname;
rev = "v${version}";
sha256 = "sha256-o2+5kMHDigrLXjwdkMKSujW/Lov72WmRvw7/aew3s9w=";
};
nativeBuildInputs = [ makeWrapper ];
checkInputs = lib.optionals (!stdenv.isDarwin) [ nettools ];
buildInputs = lib.optionals (!stdenv.isDarwin) [ iproute2 ];
vendorSha256 = "sha256-h2z+R16XS3AJdG/4gZRLton1DKYrFElGXNjOaekAC0Q=";
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 ];
};
}