From 76ff8beba86edff99708a2b6a2717cf628c966dc Mon Sep 17 00:00:00 2001 From: Moraxyc Date: Sun, 23 Jun 2024 22:59:12 +0800 Subject: [PATCH 1/2] nezha-agent: 0.17.0 -> 0.17.2 --- pkgs/by-name/ne/nezha-agent/package.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/ne/nezha-agent/package.nix b/pkgs/by-name/ne/nezha-agent/package.nix index 247e78e802f5..f96b06f2e927 100644 --- a/pkgs/by-name/ne/nezha-agent/package.nix +++ b/pkgs/by-name/ne/nezha-agent/package.nix @@ -7,16 +7,16 @@ }: buildGoModule rec { pname = "nezha-agent"; - version = "0.17.0"; + version = "0.17.2"; src = fetchFromGitHub { owner = "nezhahq"; repo = "agent"; - rev = "v${version}"; - hash = "sha256-xCoCmWdliw7zSxLv8IJl2F03TPMS3dRC40JH1XBirTI="; + rev = "refs/tags/v${version}"; + hash = "sha256-PUBomSo11URCCJB/qFeSHSS3pw/vvcgDBo9Kc0lJQLE="; }; - vendorHash = "sha256-V5ykn/0vXSrCtCX4EEoThXMKE6EVTjc9zXt89G+34N8="; + vendorHash = "sha256-wVZWP8yvazxs8sG47MTOlWzKwjsZO/b7PN987fwWEaY="; ldflags = [ "-s" @@ -36,10 +36,10 @@ buildGoModule rec { }; }; - meta = with lib; { + meta = { description = "Agent of Nezha Monitoring"; homepage = "https://github.com/nezhahq/agent"; - license = licenses.asl20; - maintainers = with maintainers; [ moraxyc ]; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ moraxyc ]; }; } From f852b38c42e8316bde820f375fc21a9078148de6 Mon Sep 17 00:00:00 2001 From: Moraxyc Date: Sun, 23 Jun 2024 23:02:10 +0800 Subject: [PATCH 2/2] nixos/nezha-agent: add gpu monitoring option --- nixos/modules/services/monitoring/nezha-agent.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/monitoring/nezha-agent.nix b/nixos/modules/services/monitoring/nezha-agent.nix index 8312a425d28f..7ebbc7f2f329 100644 --- a/nixos/modules/services/monitoring/nezha-agent.nix +++ b/nixos/modules/services/monitoring/nezha-agent.nix @@ -24,6 +24,13 @@ in Enable SSL/TLS encryption. ''; }; + gpu = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Enable GPU monitoring. + ''; + }; disableCommandExecute = lib.mkOption { type = lib.types.bool; default = true; @@ -46,7 +53,12 @@ in ''; }; reportDelay = lib.mkOption { - type = lib.types.enum [ 1 2 3 4 ]; + type = lib.types.enum [ + 1 + 2 + 3 + 4 + ]; default = 1; description = '' The interval between system status reportings. @@ -96,6 +108,7 @@ in ++ lib.optional cfg.skipConnection "--skip-conn" ++ lib.optional cfg.skipProcess "--skip-procs" ++ lib.optional cfg.tls "--tls" + ++ lib.optional cfg.gpu "--gpu" ); wantedBy = [ "multi-user.target" ]; };