summary refs log tree commit diff
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>2015-05-31 19:55:33 +0300
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-06-03 10:49:01 +0200
commita278a9224a3c1c5db399d53c86b36a25133b5cda (patch)
tree054e76a7b84efc6651ccf5820dbaff94a237375f
parentcdbb5483b7ef1dcdb628e802aab25362c01ea41c (diff)
downloadnixlib-a278a9224a3c1c5db399d53c86b36a25133b5cda.tar
nixlib-a278a9224a3c1c5db399d53c86b36a25133b5cda.tar.gz
nixlib-a278a9224a3c1c5db399d53c86b36a25133b5cda.tar.bz2
nixlib-a278a9224a3c1c5db399d53c86b36a25133b5cda.tar.lz
nixlib-a278a9224a3c1c5db399d53c86b36a25133b5cda.tar.xz
nixlib-a278a9224a3c1c5db399d53c86b36a25133b5cda.tar.zst
nixlib-a278a9224a3c1c5db399d53c86b36a25133b5cda.zip
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.
-rw-r--r--nixos/modules/system/activation/activation-script.nix4
-rw-r--r--nixos/modules/system/boot/systemd.nix12
2 files changed, 1 insertions, 15 deletions
diff --git a/nixos/modules/system/activation/activation-script.nix b/nixos/modules/system/activation/activation-script.nix
index 2e5a70b3aa54..02b3e25a313d 100644
--- a/nixos/modules/system/activation/activation-script.nix
+++ b/nixos/modules/system/activation/activation-script.nix
@@ -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
 
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix
index 052267e7ad5e..99fd2544e708 100644
--- a/nixos/modules/system/boot/systemd.nix
+++ b/nixos/modules/system/boot/systemd.nix
@@ -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}
       '';