services.fluentd: add plugins option

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

+12 -1
+12 -1
nixos/modules/services/logging/fluentd.nix
··· 4 4 5 5 let 6 6 cfg = config.services.fluentd; 7 + 8 + pluginArgs = concatStringsSep " " (map (x: "-p ${x}") cfg.plugins); 7 9 in { 8 10 ###### interface 9 11 ··· 28 30 defaultText = "pkgs.fluentd"; 29 31 description = "The fluentd package to use."; 30 32 }; 33 + 34 + plugins = mkOption { 35 + type = types.listOf types.path; 36 + default = []; 37 + description = '' 38 + A list of plugin paths to pass into fluentd. It will make plugins defined in ruby files 39 + there available in your config. 40 + ''; 41 + }; 31 42 }; 32 43 }; 33 44 ··· 39 50 description = "Fluentd Daemon"; 40 51 wantedBy = [ "multi-user.target" ]; 41 52 serviceConfig = { 42 - ExecStart = "${cfg.package}/bin/fluentd -c ${pkgs.writeText "fluentd.conf" cfg.config}"; 53 + ExecStart = "${cfg.package}/bin/fluentd -c ${pkgs.writeText "fluentd.conf" cfg.config} ${pluginArgs}"; 43 54 ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; 44 55 }; 45 56 };