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
|
@ -4,6 +4,8 @@ with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.services.fluentd;
|
cfg = config.services.fluentd;
|
||||||
|
|
||||||
|
pluginArgs = concatStringsSep " " (map (x: "-p ${x}") cfg.plugins);
|
||||||
in {
|
in {
|
||||||
###### interface
|
###### interface
|
||||||
|
|
||||||
|
@ -28,6 +30,15 @@ in {
|
||||||
defaultText = "pkgs.fluentd";
|
defaultText = "pkgs.fluentd";
|
||||||
description = "The fluentd package to use.";
|
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";
|
description = "Fluentd Daemon";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
serviceConfig = {
|
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";
|
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue