fa5436e0a7
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
45 lines
957 B
Nix
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 ];
|
|
};
|
|
}
|