summary refs log tree commit diff
path: root/nixos/modules/services
diff options
context:
space:
mode:
authorJaka Hudoklin <jakahudoklin@gmail.com>2015-03-21 22:37:48 +0100
committerJaka Hudoklin <jakahudoklin@gmail.com>2015-03-21 22:37:48 +0100
commitad10db76178fce8581695253503c8562dc42613f (patch)
treea6397ff16e3bc8e39a7d36057bc51c94d6b6198f /nixos/modules/services
parent916aab2927bf6ba8b157a646d9535246253a6b18 (diff)
parentfca0aa707715a50e2d5fd3a0a5d67f14008ce376 (diff)
downloadnixlib-ad10db76178fce8581695253503c8562dc42613f.tar
nixlib-ad10db76178fce8581695253503c8562dc42613f.tar.gz
nixlib-ad10db76178fce8581695253503c8562dc42613f.tar.bz2
nixlib-ad10db76178fce8581695253503c8562dc42613f.tar.lz
nixlib-ad10db76178fce8581695253503c8562dc42613f.tar.xz
nixlib-ad10db76178fce8581695253503c8562dc42613f.tar.zst
nixlib-ad10db76178fce8581695253503c8562dc42613f.zip
Merge pull request #6882 from offlinehacker/nixos/fluentd
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}";
+      };
+    };
+  };
+}