summary refs log tree commit diff
path: root/nixos/modules/services
diff options
context:
space:
mode:
authorJaka Hudoklin <jakahudoklin@gmail.com>2015-03-18 20:33:52 +0100
committerJaka Hudoklin <jakahudoklin@gmail.com>2015-03-18 21:18:47 +0100
commitfca0aa707715a50e2d5fd3a0a5d67f14008ce376 (patch)
treed0a5b17683a9b20efb7a97e43bb8f73d214f3f82 /nixos/modules/services
parent2bc6af3efccec7ff6087bea7c7b1754c5d2c7393 (diff)
downloadnixlib-fca0aa707715a50e2d5fd3a0a5d67f14008ce376.tar
nixlib-fca0aa707715a50e2d5fd3a0a5d67f14008ce376.tar.gz
nixlib-fca0aa707715a50e2d5fd3a0a5d67f14008ce376.tar.bz2
nixlib-fca0aa707715a50e2d5fd3a0a5d67f14008ce376.tar.lz
nixlib-fca0aa707715a50e2d5fd3a0a5d67f14008ce376.tar.xz
nixlib-fca0aa707715a50e2d5fd3a0a5d67f14008ce376.tar.zst
nixlib-fca0aa707715a50e2d5fd3a0a5d67f14008ce376.zip
Add fluentd package and module
Diffstat (limited to 'nixos/modules/services')
-rw-r--r--nixos/modules/services/logging/fluentd.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/nixos/modules/services/logging/fluentd.nix b/nixos/modules/services/logging/fluentd.nix
new file mode 100644
index 000000000000..61eeec504e0d
--- /dev/null
+++ b/nixos/modules/services/logging/fluentd.nix
@@ -0,0 +1,39 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+  cfg = config.services.fluentd;
+in {
+  ###### interface
+
+  options = {
+
+    services.fluentd = {
+      enable = mkOption {
+        type = types.bool;
+        default = false;
+        description = "Whether to enable fluentd.";
+      };
+
+      config = mkOption {
+        type = types.lines;
+        default = "";
+        description = "Fluentd config.";
+      };
+    };
+  };
+
+
+  ###### implementation
+
+  config = mkIf cfg.enable {
+    systemd.services.fluentd = with pkgs; {
+      description = "Fluentd Daemon";
+      wantedBy = [ "multi-user.target" ];
+      serviceConfig = {
+        ExecStart = "${pkgs.fluentd}/bin/fluentd -c ${pkgs.writeText "fluentd.conf" cfg.config}";
+      };
+    };
+  };
+}