nezha-agent: init at 0.16.3

This commit is contained in:
Moraxyc 2024-04-01 03:26:30 +08:00
parent a31b5f20ac
commit 482ffcfacd
No known key found for this signature in database

View File

@ -0,0 +1,45 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nezha-agent,
testers,
}:
buildGoModule rec {
pname = "nezha-agent";
version = "0.16.3";
src = fetchFromGitHub {
owner = "nezhahq";
repo = "agent";
rev = "v${version}";
hash = "sha256-DeZzR25KWxA70nS0mICaOb0TeBhnurm3FWLNS/EjwZA=";
};
vendorHash = "sha256-b8jICFsQaSetBzhTiq8zBX/LYuhQNly5kj45ZV6NDiY=";
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];
};
}