depot/third_party/nixpkgs/pkgs/by-name/ne/nezha-agent/package.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

45 lines
956 B
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
nezha-agent,
testers,
}:
buildGoModule rec {
pname = "nezha-agent";
version = "0.16.7";
src = fetchFromGitHub {
owner = "nezhahq";
repo = "agent";
rev = "v${version}";
hash = "sha256-SKPDNYbtN93GVOlghYS69iHORDUshN47lAZ9DDoX0jM=";
};
vendorHash = "sha256-kqu3+hO0juxI5qbczVFg0GF+pljmePFbKd59a14U7Pg=";
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 ];
};
}