services.fluentd: add plugins option

This allows us to pass in additional ad-hoc fluentd plugins for custom
output formats and other goodness.

Changed files
+12 -1
nixos
modules
services
logging
+12 -1
nixos/modules/services/logging/fluentd.nix
···
let
cfg = config.services.fluentd;
in {
###### interface
···
defaultText = "pkgs.fluentd";
description = "The fluentd package to use.";
};
};
};
···
description = "Fluentd Daemon";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
-
ExecStart = "${cfg.package}/bin/fluentd -c ${pkgs.writeText "fluentd.conf" cfg.config}";
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
};
};
···
let
cfg = config.services.fluentd;
+
+
pluginArgs = concatStringsSep " " (map (x: "-p ${x}") cfg.plugins);
in {
###### interface
···
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.
+
'';
+
};
};
};
···
description = "Fluentd Daemon";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
+
ExecStart = "${cfg.package}/bin/fluentd -c ${pkgs.writeText "fluentd.conf" cfg.config} ${pluginArgs}";
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
};
};