From 3386a3aab0d20f52ce77db76e564a43972f4c42c Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Sun, 24 Mar 2024 16:58:39 +0100 Subject: [PATCH] nixos/netdata: introduce `recommendedPythonPackages` This option furthers the "zero configuration" reputation of netdata by collecting some Python packages available in nixpkgs and offering them to the module. It is disabled by default. Signed-off-by: Raito Bezarius --- nixos/modules/services/monitoring/netdata.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/nixos/modules/services/monitoring/netdata.nix b/nixos/modules/services/monitoring/netdata.nix index 6e1e5d5e3c22..f604a6835b08 100644 --- a/nixos/modules/services/monitoring/netdata.nix +++ b/nixos/modules/services/monitoring/netdata.nix @@ -89,6 +89,14 @@ in { Whether to enable python-based plugins ''; }; + recommendedPythonPackages = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc '' + Whether to enable a set of recommended Python plugins + by installing extra Python packages. + ''; + }; extraPackages = mkOption { type = types.functionTo (types.listOf types.package); default = ps: []; @@ -201,6 +209,17 @@ in { } ]; + # Includes a set of recommended Python plugins in exchange of imperfect disk consumption. + services.netdata.python.extraPackages = lib.mkIf cfg.python.recommendedPythonPackages (ps: [ + ps.requests + ps.pandas + ps.numpy + ps.psycopg2 + ps.python-ldap + ps.netdata-pandas + ps.changefinder + ]); + services.netdata.configDir.".opt-out-from-anonymous-statistics" = mkIf (!cfg.enableAnalyticsReporting) (pkgs.writeText ".opt-out-from-anonymous-statistics" ""); environment.etc."netdata/netdata.conf".source = configFile; environment.etc."netdata/conf.d".source = configDirectory;