services.fluentd: add plugins option
This allows us to pass in additional ad-hoc fluentd plugins for custom output formats and other goodness.
This commit is contained in:
parent
7e3e790675
commit
b48ffa332b
1 changed files with 12 additions and 1 deletions
|
@ -4,6 +4,8 @@ with lib;
|
|||
|
||||
let
|
||||
cfg = config.services.fluentd;
|
||||
|
||||
pluginArgs = concatStringsSep " " (map (x: "-p ${x}") cfg.plugins);
|
||||
in {
|
||||
###### interface
|
||||
|
||||
|
@ -28,6 +30,15 @@ in {
|
|||
defaultText = "pkgs.fluentd";
|
||||
description = "The fluentd package to use.";
|
||||
};
|
||||
|
||||
plugins = mkOption {
|
||||
type = types.listOf types.path;
|
||||
default = [];
|
||||
description = ''
|
||||
A list of plugin paths to pass into fluentd. It will make plugins defined in ruby files
|
||||
there available in your config.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -39,7 +50,7 @@ in {
|
|||
description = "Fluentd Daemon";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${cfg.package}/bin/fluentd -c ${pkgs.writeText "fluentd.conf" cfg.config}";
|
||||
ExecStart = "${cfg.package}/bin/fluentd -c ${pkgs.writeText "fluentd.conf" cfg.config} ${pluginArgs}";
|
||||
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue