nezha-agent: add updateScript; 0.20.3 -> 0.20.5 (#358660)

This commit is contained in:
Nick Cao 2024-11-26 08:44:16 -05:00 committed by GitHub
commit a17db8891e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 3 deletions

View File

@ -52,6 +52,20 @@ in
Disable executing the command from dashboard.
'';
};
disableNat = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Disable NAT penetration.
'';
};
disableSendQuery = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Disable sending TCP/ICMP/HTTP requests.
'';
};
skipConnection = lib.mkOption {
type = lib.types.bool;
default = false;
@ -125,6 +139,8 @@ in
]
++ lib.optional cfg.debug "--debug"
++ lib.optional cfg.disableCommandExecute "--disable-command-execute"
++ lib.optional cfg.disableNat "--disable-nat"
++ lib.optional cfg.disableSendQuery "--disable-send-query"
++ lib.optional (cfg.reportDelay != null) "--report-delay ${toString cfg.reportDelay}"
++ lib.optional (cfg.server != null) "--server ${cfg.server}"
++ lib.optional cfg.skipConnection "--skip-conn"

View File

@ -4,19 +4,20 @@
stdenv,
fetchFromGitHub,
versionCheckHook,
nix-update-script,
}:
buildGoModule rec {
pname = "nezha-agent";
version = "0.20.3";
version = "0.20.5";
src = fetchFromGitHub {
owner = "nezhahq";
repo = "agent";
rev = "refs/tags/v${version}";
hash = "sha256-cLLiJbAr7TxVUNV31Y9TG8ZL4uqBCOnrOr1FM4+1U5c=";
hash = "sha256-CVE1c0LLheGlH8oMWQWs6fox7mlHc5Y2O9XQ6kqXAwI=";
};
vendorHash = "sha256-q6/265vVg6jCnDvs825nni8QFHkJpQz4xxC9MlJH2do=";
vendorHash = "sha256-ytFsTHl6kVwmqCabaMDxxijszY3jzWWUIZKBCebPMkI=";
ldflags = [
"-s"
@ -54,6 +55,10 @@ buildGoModule rec {
versionCheckHook
];
passthru = {
updateScript = nix-update-script { };
};
meta = {
description = "Agent of Nezha Monitoring";
homepage = "https://github.com/nezhahq/agent";