about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2020-04-16 12:55:43 +0100
committerJörg Thalheim <joerg@thalheim.io>2020-04-16 13:02:24 +0100
commit4cc7c2e55a231145201edc6473f7919e85473bf3 (patch)
tree6488dbded92b9ea390a0581340f7836f4aa2f10b /nixos/modules
parentfd438d5f09d8f8da3d46b7258507abef1571278c (diff)
downloadnixlib-4cc7c2e55a231145201edc6473f7919e85473bf3.tar
nixlib-4cc7c2e55a231145201edc6473f7919e85473bf3.tar.gz
nixlib-4cc7c2e55a231145201edc6473f7919e85473bf3.tar.bz2
nixlib-4cc7c2e55a231145201edc6473f7919e85473bf3.tar.lz
nixlib-4cc7c2e55a231145201edc6473f7919e85473bf3.tar.xz
nixlib-4cc7c2e55a231145201edc6473f7919e85473bf3.tar.zst
nixlib-4cc7c2e55a231145201edc6473f7919e85473bf3.zip
tmpfiles: load user-defined entries first
systemd-tmpfiles will load all files in lexicographic order and ignores rules
for the same path in later files with a warning Since we apply the default rules
provided by systemd, we should load user-defines rules first so users have a
chance to override defaults.
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/system/boot/systemd.nix14
1 files changed, 7 insertions, 7 deletions
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix
index 7f207e6c7ef4..518d875841bd 100644
--- a/nixos/modules/system/boot/systemd.nix
+++ b/nixos/modules/system/boot/systemd.nix
@@ -894,6 +894,13 @@ in
       "sysctl.d/50-coredump.conf".source = "${systemd}/example/sysctl.d/50-coredump.conf";
       "sysctl.d/50-default.conf".source = "${systemd}/example/sysctl.d/50-default.conf";
 
+      "tmpfiles.d/00-nixos.conf".text = ''
+        # This file is created automatically and should not be modified.
+        # Please change the option ‘systemd.tmpfiles.rules’ instead.
+
+        ${concatStringsSep "\n" cfg.tmpfiles.rules}
+      '';
+
       "tmpfiles.d/home.conf".source = "${systemd}/example/tmpfiles.d/home.conf";
       "tmpfiles.d/journal-nocow.conf".source = "${systemd}/example/tmpfiles.d/journal-nocow.conf";
       "tmpfiles.d/portables.conf".source = "${systemd}/example/tmpfiles.d/portables.conf";
@@ -906,13 +913,6 @@ in
       "tmpfiles.d/var.conf".source = "${systemd}/example/tmpfiles.d/var.conf";
       "tmpfiles.d/x11.conf".source = "${systemd}/example/tmpfiles.d/x11.conf";
 
-      "tmpfiles.d/nixos.conf".text = ''
-        # This file is created automatically and should not be modified.
-        # Please change the option ‘systemd.tmpfiles.rules’ instead.
-
-        ${concatStringsSep "\n" cfg.tmpfiles.rules}
-      '';
-
       "systemd/system-generators" = { source = hooks "generators" cfg.generators; };
       "systemd/system-shutdown" = { source = hooks "shutdown" cfg.shutdown; };
     });