summary refs log tree commit diff
path: root/nixos/modules/services/logging
diff options
context:
space:
mode:
authorDan Peebles <pumpkin@me.com>2017-08-08 22:02:56 +0000
committerDan Peebles <pumpkin@me.com>2017-08-08 22:02:56 +0000
commitb48ffa332bb9814a04a766072f25e08c3f5abe44 (patch)
treeec24ecae765d5b2657b359b3bb242903d4892916 /nixos/modules/services/logging
parent7e3e7906759c2900086baf0218581366e8b7f51e (diff)
downloadnixpkgs-b48ffa332bb9814a04a766072f25e08c3f5abe44.tar
nixpkgs-b48ffa332bb9814a04a766072f25e08c3f5abe44.tar.gz
nixpkgs-b48ffa332bb9814a04a766072f25e08c3f5abe44.tar.bz2
nixpkgs-b48ffa332bb9814a04a766072f25e08c3f5abe44.tar.lz
nixpkgs-b48ffa332bb9814a04a766072f25e08c3f5abe44.tar.xz
nixpkgs-b48ffa332bb9814a04a766072f25e08c3f5abe44.tar.zst
nixpkgs-b48ffa332bb9814a04a766072f25e08c3f5abe44.zip
services.fluentd: add plugins option
This allows us to pass in additional ad-hoc fluentd plugins for custom
output formats and other goodness.
Diffstat (limited to 'nixos/modules/services/logging')
-rw-r--r--nixos/modules/services/logging/fluentd.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/nixos/modules/services/logging/fluentd.nix b/nixos/modules/services/logging/fluentd.nix
index 9fbec245737..95825705d9d 100644
--- a/nixos/modules/services/logging/fluentd.nix
+++ b/nixos/modules/services/logging/fluentd.nix
@@ -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";
       };
     };