nixos/collectd: add plugin config

This commit is contained in:
Astro 2019-10-17 21:40:57 +02:00
parent abf263fed7
commit e2283d9533

View File

@ -16,8 +16,15 @@ let
NotifyLevel "OKAY" NotifyLevel "OKAY"
</Plugin> </Plugin>
${concatStrings (mapAttrsToList (plugin: pluginConfig: ''
LoadPlugin ${plugin}
<Plugin "${plugin}">
${pluginConfig}
</Plugin>
'') cfg.plugins)}
${concatMapStrings (f: '' ${concatMapStrings (f: ''
Include "${f}" Include "${f}"
'') cfg.include} '') cfg.include}
${cfg.extraConfig} ${cfg.extraConfig}
@ -68,6 +75,15 @@ in {
type = listOf str; type = listOf str;
}; };
plugins = mkOption {
default = {};
example = { cpu = ""; memory = ""; network = "Server 192.168.1.1 25826"; };
description = ''
Attribute set of plugin names to plugin config segments
'';
type = types.attrsOf types.str;
};
extraConfig = mkOption { extraConfig = mkOption {
default = ""; default = "";
description = '' description = ''