systemd: Use upstream tmpfiles.d rules

This fixes a failing assert in systemd-timesyncd (issue #5913) as it
expects the directory /run/systemd/netif/links/ to exist, and nothing in
NixOS currently creates it.

Also we get a net reduction in our code as rules for /run/utmp and
/var/log/journal are also provided by the same upstream file.
This commit is contained in:
Tuomas Tynkkynen 2015-05-31 19:55:33 +03:00 committed by Eelco Dolstra
parent cdbb5483b7
commit a278a9224a
2 changed files with 1 additions and 15 deletions

View file

@ -114,10 +114,6 @@ in
''
# Various log/runtime directories.
touch /run/utmp # must exist
chgrp ${toString config.ids.gids.utmp} /run/utmp
chmod 664 /run/utmp
mkdir -m 0755 -p /run/nix/current-load # for distributed builds
mkdir -m 0700 -p /run/nix/remote-stores

View file

@ -638,13 +638,6 @@ in
system.activationScripts.systemd = stringAfter [ "groups" ]
''
mkdir -m 0755 -p /var/lib/udev
mkdir -p /var/log/journal
chmod 0755 /var/log/journal
# Make all journals readable to users in the wheel and adm
# groups, in addition to those in the systemd-journal group.
# Users can always read their own journals.
${pkgs.acl}/bin/setfacl -nm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal || true
if ! [ -e /etc/machine-id ]; then
${systemd}/bin/systemd-machine-id-setup
@ -730,6 +723,7 @@ in
startSession = true;
};
environment.etc."tmpfiles.d/systemd.conf".source = "${systemd}/example/tmpfiles.d/systemd.conf";
environment.etc."tmpfiles.d/x11.conf".source = "${systemd}/example/tmpfiles.d/x11.conf";
environment.etc."tmpfiles.d/nixos.conf".text =
@ -737,10 +731,6 @@ in
# This file is created automatically and should not be modified.
# Please change the option systemd.tmpfiles.rules instead.
z /var/log/journal 2755 root systemd-journal - -
z /var/log/journal/%m 2755 root systemd-journal - -
z /var/log/journal/%m/* 0640 root systemd-journal - -
${concatStringsSep "\n" cfg.tmpfiles.rules}
'';