8 cfg = config.services.fluentd;
10 pluginArgs = lib.concatStringsSep " " (map (x: "-p ${x}") cfg.plugins);
18 enable = lib.mkEnableOption "fluentd, a data/log collector";
20 config = lib.mkOption {
21 type = lib.types.lines;
23 description = "Fluentd config.";
26 package = lib.mkPackageOption pkgs "fluentd" { };
28 plugins = lib.mkOption {
29 type = lib.types.listOf lib.types.path;
32 A list of plugin paths to pass into fluentd. It will make plugins defined in ruby files
33 there available in your config.
41 config = lib.mkIf cfg.enable {
42 systemd.services.fluentd = with pkgs; {
43 description = "Fluentd Daemon";
44 wantedBy = [ "multi-user.target" ];
46 ExecStart = "${cfg.package}/bin/fluentd -c ${pkgs.writeText "fluentd.conf" cfg.config} ${pluginArgs}";
47 ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";