Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions nixos/modules/misc/ids.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down
19 changes: 19 additions & 0 deletions nixos/modules/system/boot/systemd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 =
Expand Down
8 changes: 6 additions & 2 deletions pkgs/os-specific/linux/systemd/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{ stdenv, fetchurl, pkgconfig, intltool, gperf, libcap, dbus, kmod
, xz, pam, acl, cryptsetup, libuuid, m4, utillinux
, glib, kbd, libxslt, coreutils, libgcrypt, sysvtools, docbook_xsl
, kexectools
, kexectools, libmicrohttpd
, python ? null, pythonSupport ? false
}:

assert stdenv.isLinux;

assert pythonSupport -> python != null;

stdenv.mkDerivation rec {
version = "203";
name = "systemd-${version}";
Expand All @@ -25,7 +28,8 @@ stdenv.mkDerivation rec {
buildInputs =
[ pkgconfig intltool gperf libcap dbus.libs kmod xz pam acl
/* cryptsetup */ libuuid m4 glib libxslt libgcrypt docbook_xsl
];
libmicrohttpd
] ++ stdenv.lib.optional pythonSupport python;

configureFlags =
[ "--localstatedir=/var"
Expand Down