diff --git a/nixos/modules/services/monitoring/netdata.nix b/nixos/modules/services/monitoring/netdata.nix
index 4873ab1fc60..1d86c5d893d 100644
--- a/nixos/modules/services/monitoring/netdata.nix
+++ b/nixos/modules/services/monitoring/netdata.nix
@@ -10,9 +10,14 @@ let
ln -s /run/wrappers/bin/apps.plugin $out/libexec/netdata/plugins.d/apps.plugin
'';
+ plugins = [
+ "${pkgs.netdata}/libexec/netdata/plugins.d"
+ "${wrappedPlugins}/libexec/netdata/plugins.d"
+ ] ++ cfg.extraPluginPaths;
+
localConfig = {
global = {
- "plugins directory" = "${pkgs.netdata}/libexec/netdata/plugins.d ${wrappedPlugins}/libexec/netdata/plugins.d";
+ "plugins directory" = concatStringsSep " " plugins;
};
web = {
"web files owner" = "root";
@@ -78,6 +83,24 @@ in {
};
};
+ extraPluginPaths = mkOption {
+ type = types.listOf types.path;
+ default = [ ];
+ example = literalExample ''
+ [ "/path/to/plugins.d" ]
+ '';
+ description = ''
+ Extra paths to add to the netdata global "plugins directory"
+ option. Useful for when you want to include your own
+ collection scripts.
+
+ Details about writing a custom netdata plugin are available at:
+
+
+ Cannot be combined with configText.
+ '';
+ };
+
config = mkOption {
type = types.attrsOf types.attrs;
default = {};