summary refs log tree commit diff
path: root/nixos
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
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')
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/services/logging/fluentd.nix39
2 files changed, 40 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 28dad095761f..71915a0d3eb7 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -161,6 +161,7 @@
   ./services/hardware/udisks2.nix
   ./services/hardware/upower.nix
   ./services/hardware/thermald.nix
+  ./services/logging/fluentd.nix
   ./services/logging/klogd.nix
   ./services/logging/logcheck.nix
   ./services/logging/logrotate.nix
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}";
+      };
+    };
+  };
+}