depot/third_party/nixpkgs/pkgs/by-name/ne/nezha-agent/package.nix
Default email 5ca88bfbb9 Project import generated by Copybara.
GitOrigin-RevId: 9f918d616c5321ad374ae6cb5ea89c9e04bf3e58
2024-07-31 10:19:44 +00:00

45 lines
964 B
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
nezha-agent,
testers,
}:
buildGoModule rec {
pname = "nezha-agent";
version = "0.18.5";
src = fetchFromGitHub {
owner = "nezhahq";
repo = "agent";
rev = "refs/tags/v${version}";
hash = "sha256-LmWfs3aL+1lsX4ix2FjDP5g+A0wgcfziXdw5SaKlAdk=";
};
vendorHash = "sha256-frPAhiexFSt+KobMbf32h8xv7HMcPl5koEgSs8Nz3cs=";
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 = {
description = "Agent of Nezha Monitoring";
homepage = "https://github.com/nezhahq/agent";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ moraxyc ];
};
}