From fca0aa707715a50e2d5fd3a0a5d67f14008ce376 Mon Sep 17 00:00:00 2001 From: Jaka Hudoklin Date: Wed, 18 Mar 2015 20:33:52 +0100 Subject: Add fluentd package and module --- nixos/modules/module-list.nix | 1 + nixos/modules/services/logging/fluentd.nix | 39 ++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 nixos/modules/services/logging/fluentd.nix (limited to 'nixos') diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index c8cf5bfa7981..f19456f51438 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -160,6 +160,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}"; + }; + }; + }; +} -- cgit 1.4.1