From 616b4b5b0ef8ac9bcb2ce7b577040f0b209e34b6 Mon Sep 17 00:00:00 2001 From: Jaka Hudoklin Date: Sat, 1 Feb 2014 14:50:20 +0100 Subject: nixos/systemd: add journal http gateway support --- nixos/modules/misc/ids.nix | 2 ++ nixos/modules/system/boot/systemd.nix | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'nixos/modules') diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix index 16eec9043212..0a585139521d 100644 --- a/nixos/modules/misc/ids.nix +++ b/nixos/modules/misc/ids.nix @@ -110,6 +110,7 @@ openldap = 99; memcached = 100; cgminer = 101; + systemd-journal-gateway = 102; # When adding a uid, make sure it doesn't match an existing gid. @@ -199,6 +200,7 @@ haproxy = 92; openldap = 93; connman = 94; + systemd-journal-gateway = 95; # When adding a gid, make sure it doesn't match an existing uid. diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index b575deb24b7b..aaa496955402 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -132,6 +132,11 @@ let ++ optionals cfg.enableEmergencyMode [ "emergency.target" "emergency.service" + ] + + ++ optionals config.services.journald.enableHttpGateway [ + "systemd-journal-gatewayd.socket" + "systemd-journal-gatewayd.service" ]; upstreamWants = @@ -372,6 +377,10 @@ let ln -s ../local-fs.target ../remote-fs.target ../network.target ../nss-lookup.target \ ../nss-user-lookup.target ../swap.target $out/multi-user.target.wants/ + + ${ optionalString config.services.journald.enableHttpGateway '' + ln -s ../systemd-journal-gatewayd.service $out/multi-user-target.wants/ + ''} ''; # */ in @@ -567,6 +576,14 @@ in ''; }; + services.journald.enableHttpGateway = mkOption { + default = false; + type = types.bool; + description = '' + Enable journal http gateway + ''; + }; + services.logind.extraConfig = mkOption { default = ""; type = types.lines; @@ -673,6 +690,8 @@ in }; users.extraGroups.systemd-journal.gid = config.ids.gids.systemd-journal; + users.extraUsers.systemd-journal-gateway.uid = config.ids.uids.systemd-journal-gateway; + users.extraGroups.systemd-journal-gateway.gid = config.ids.gids.systemd-journal-gateway; # Generate timer units for all services that have a ‘startAt’ value. systemd.timers = -- cgit 1.4.1