depot/third_party/nixpkgs/pkgs/by-name/ne/nezha-agent/package.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

45 lines
957 B
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
nezha-agent,
testers,
}:
buildGoModule rec {
pname = "nezha-agent";
version = "0.16.11";
src = fetchFromGitHub {
owner = "nezhahq";
repo = "agent";
rev = "v${version}";
hash = "sha256-mcTS+PjFa5niWhe8pmWmuYpx+Y9ZWX0hpcLEodN/SIs=";
};
vendorHash = "sha256-L6QdodI8Ur1H6Zc24KSTYAHfzvW2aq9SYwCVgjvSDII=";
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
];
# The test failed due to a geoip request in the sandbox. Remove it to avoid network requirement
preCheck = ''
rm ./pkg/monitor/myip_test.go
'';
passthru.tests = {
version = testers.testVersion {
package = nezha-agent;
command = "${nezha-agent}/bin/agent -v";
};
};
meta = with lib; {
description = "Agent of Nezha Monitoring";
homepage = "https://github.com/nezhahq/agent";
license = licenses.asl20;
maintainers = with maintainers; [ moraxyc ];
};
}