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. (cherry picked from commit a278a9224a3c1c5db399d53c86b36a25133b5cda)
This commit is contained in:
parent
eedda353f3
commit
5d02c02a9b
@ -114,10 +114,6 @@ in
|
|||||||
''
|
''
|
||||||
# Various log/runtime directories.
|
# 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 0755 -p /run/nix/current-load # for distributed builds
|
||||||
mkdir -m 0700 -p /run/nix/remote-stores
|
mkdir -m 0700 -p /run/nix/remote-stores
|
||||||
|
|
||||||
|
@ -639,13 +639,6 @@ in
|
|||||||
system.activationScripts.systemd = stringAfter [ "groups" ]
|
system.activationScripts.systemd = stringAfter [ "groups" ]
|
||||||
''
|
''
|
||||||
mkdir -m 0755 -p /var/lib/udev
|
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
|
if ! [ -e /etc/machine-id ]; then
|
||||||
${systemd}/bin/systemd-machine-id-setup
|
${systemd}/bin/systemd-machine-id-setup
|
||||||
@ -731,6 +724,7 @@ in
|
|||||||
startSession = true;
|
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/x11.conf".source = "${systemd}/example/tmpfiles.d/x11.conf";
|
||||||
|
|
||||||
environment.etc."tmpfiles.d/nixos.conf".text =
|
environment.etc."tmpfiles.d/nixos.conf".text =
|
||||||
@ -738,10 +732,6 @@ in
|
|||||||
# This file is created automatically and should not be modified.
|
# This file is created automatically and should not be modified.
|
||||||
# Please change the option ‘systemd.tmpfiles.rules’ instead.
|
# 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}
|
${concatStringsSep "\n" cfg.tmpfiles.rules}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user