1 { config, lib, pkgs, ... }:
2 let cfg = config.services.SystemdJournal2Gelf;
6 services.SystemdJournal2Gelf = {
7 enable = lib.mkOption {
11 Whether to enable SystemdJournal2Gelf.
15 graylogServer = lib.mkOption {
17 example = "graylog2.example.com:11201";
19 Host and port of your graylog2 input. This should be a GELF
24 extraOptions = lib.mkOption {
25 type = lib.types.separatedString " ";
28 Any extra flags to pass to SystemdJournal2Gelf. Note that
29 these are basically `journalctl` flags.
33 package = lib.mkPackageOption pkgs "systemd-journal2gelf" { };
38 config = lib.mkIf cfg.enable {
39 systemd.services.SystemdJournal2Gelf = {
40 description = "SystemdJournal2Gelf";
41 after = [ "network.target" ];
42 wantedBy = [ "multi-user.target" ];
44 ExecStart = "${cfg.package}/bin/SystemdJournal2Gelf ${cfg.graylogServer} --follow ${cfg.extraOptions}";
45 Restart = "on-failure";