Skip to content

Commit

Permalink
nezha-agent: add updateScript; 0.20.3 -> 0.20.5 (#358660)
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCao authored Nov 26, 2024
2 parents 1b1d91f + b84c7c2 commit a17db88
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
16 changes: 16 additions & 0 deletions nixos/modules/services/monitoring/nezha-agent.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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"
Expand Down
11 changes: 8 additions & 3 deletions pkgs/by-name/ne/nezha-agent/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -54,6 +55,10 @@ buildGoModule rec {
versionCheckHook
];

passthru = {
updateScript = nix-update-script { };
};

meta = {
description = "Agent of Nezha Monitoring";
homepage = "https://github.com/nezhahq/agent";
Expand Down

0 comments on commit a17db88

Please sign in to comment.