Loading nixos/modules/services/monitoring/nezha-agent.nix +17 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,20 @@ in Enable GPU monitoring. ''; }; temperature = lib.mkOption { type = lib.types.bool; default = true; description = '' Enable temperature monitoring. ''; }; useIPv6CountryCode = lib.mkOption { type = lib.types.bool; default = true; description = '' Use ipv6 countrycode to report location. ''; }; disableCommandExecute = lib.mkOption { type = lib.types.bool; default = true; Loading Loading @@ -96,7 +110,7 @@ in startLimitBurst = 3; script = lib.concatStringsSep " " ( [ "${cfg.package}/bin/agent" "${lib.getExe cfg.package}" "--disable-auto-update" "--disable-force-update" "--password $(cat ${cfg.passwordFile})" Loading @@ -109,6 +123,8 @@ in ++ lib.optional cfg.skipProcess "--skip-procs" ++ lib.optional cfg.tls "--tls" ++ lib.optional cfg.gpu "--gpu" ++ lib.optional cfg.temperature "--temperature" ++ lib.optional cfg.useIPv6CountryCode "--use-ipv6-countrycode" ); wantedBy = [ "multi-user.target" ]; }; Loading pkgs/by-name/ne/nezha-agent/package.nix +33 −12 Original line number Diff line number Diff line { lib, buildGoModule, stdenv, fetchFromGitHub, nezha-agent, versionCheckHook, testers, }: buildGoModule rec { pname = "nezha-agent"; version = "0.18.5"; version = "0.20.2"; src = fetchFromGitHub { owner = "nezhahq"; repo = "agent"; rev = "refs/tags/v${version}"; hash = "sha256-LmWfs3aL+1lsX4ix2FjDP5g+A0wgcfziXdw5SaKlAdk="; hash = "sha256-BM3FhCf9zfccC2xC/Fhz2/andZmPYsJojMRUA3M9NOQ="; }; vendorHash = "sha256-frPAhiexFSt+KobMbf32h8xv7HMcPl5koEgSs8Nz3cs="; vendorHash = "sha256-q6/265vVg6jCnDvs825nni8QFHkJpQz4xxC9MlJH2do="; ldflags = [ "-s" "-w" "-X main.version=${version}" "-X main.arch=${stdenv.hostPlatform.system}" ]; # The test failed due to a geoip request in the sandbox. Remove it to avoid network requirement preCheck = '' rm ./pkg/monitor/myip_test.go checkFlags = let # Skip tests that require network access skippedTests = [ "TestLookupIP" "TestGeoIPApi" "TestFetchGeoIP" "TestCloudflareDetection" ]; in [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ]; postInstall = '' pushd $out/bin mv agent nezha-agent # for compatibility ln -sr nezha-agent agent popd ''; passthru.tests = { version = testers.testVersion { package = nezha-agent; command = "${nezha-agent}/bin/agent -v"; }; }; doInstallCheck = true; versionCheckProgramArg = "-v"; nativeInstallCheckInputs = [ versionCheckHook ]; meta = { description = "Agent of Nezha Monitoring"; homepage = "https://github.com/nezhahq/agent"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ moraxyc ]; mainProgram = "nezha-agent"; }; } Loading
nixos/modules/services/monitoring/nezha-agent.nix +17 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,20 @@ in Enable GPU monitoring. ''; }; temperature = lib.mkOption { type = lib.types.bool; default = true; description = '' Enable temperature monitoring. ''; }; useIPv6CountryCode = lib.mkOption { type = lib.types.bool; default = true; description = '' Use ipv6 countrycode to report location. ''; }; disableCommandExecute = lib.mkOption { type = lib.types.bool; default = true; Loading Loading @@ -96,7 +110,7 @@ in startLimitBurst = 3; script = lib.concatStringsSep " " ( [ "${cfg.package}/bin/agent" "${lib.getExe cfg.package}" "--disable-auto-update" "--disable-force-update" "--password $(cat ${cfg.passwordFile})" Loading @@ -109,6 +123,8 @@ in ++ lib.optional cfg.skipProcess "--skip-procs" ++ lib.optional cfg.tls "--tls" ++ lib.optional cfg.gpu "--gpu" ++ lib.optional cfg.temperature "--temperature" ++ lib.optional cfg.useIPv6CountryCode "--use-ipv6-countrycode" ); wantedBy = [ "multi-user.target" ]; }; Loading
pkgs/by-name/ne/nezha-agent/package.nix +33 −12 Original line number Diff line number Diff line { lib, buildGoModule, stdenv, fetchFromGitHub, nezha-agent, versionCheckHook, testers, }: buildGoModule rec { pname = "nezha-agent"; version = "0.18.5"; version = "0.20.2"; src = fetchFromGitHub { owner = "nezhahq"; repo = "agent"; rev = "refs/tags/v${version}"; hash = "sha256-LmWfs3aL+1lsX4ix2FjDP5g+A0wgcfziXdw5SaKlAdk="; hash = "sha256-BM3FhCf9zfccC2xC/Fhz2/andZmPYsJojMRUA3M9NOQ="; }; vendorHash = "sha256-frPAhiexFSt+KobMbf32h8xv7HMcPl5koEgSs8Nz3cs="; vendorHash = "sha256-q6/265vVg6jCnDvs825nni8QFHkJpQz4xxC9MlJH2do="; ldflags = [ "-s" "-w" "-X main.version=${version}" "-X main.arch=${stdenv.hostPlatform.system}" ]; # The test failed due to a geoip request in the sandbox. Remove it to avoid network requirement preCheck = '' rm ./pkg/monitor/myip_test.go checkFlags = let # Skip tests that require network access skippedTests = [ "TestLookupIP" "TestGeoIPApi" "TestFetchGeoIP" "TestCloudflareDetection" ]; in [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ]; postInstall = '' pushd $out/bin mv agent nezha-agent # for compatibility ln -sr nezha-agent agent popd ''; passthru.tests = { version = testers.testVersion { package = nezha-agent; command = "${nezha-agent}/bin/agent -v"; }; }; doInstallCheck = true; versionCheckProgramArg = "-v"; nativeInstallCheckInputs = [ versionCheckHook ]; meta = { description = "Agent of Nezha Monitoring"; homepage = "https://github.com/nezhahq/agent"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ moraxyc ]; mainProgram = "nezha-agent"; }; }