about summary refs log tree commit diff
diff options
context:
space:
mode:
authorK900 <me@0upti.me>2023-11-29 09:38:27 +0300
committerGitHub <noreply@github.com>2023-11-29 09:38:27 +0300
commit9ad22d35b67cf3bb03ffd56e96f38bcdbb9163a0 (patch)
tree00e73bca3e6893f70b6c693969afe2b0f3eda3c1
parentf6a4e680a9bef3336437543ab372bd191a8f97eb (diff)
downloadnixlib-9ad22d35b67cf3bb03ffd56e96f38bcdbb9163a0.tar
nixlib-9ad22d35b67cf3bb03ffd56e96f38bcdbb9163a0.tar.gz
nixlib-9ad22d35b67cf3bb03ffd56e96f38bcdbb9163a0.tar.bz2
nixlib-9ad22d35b67cf3bb03ffd56e96f38bcdbb9163a0.tar.lz
nixlib-9ad22d35b67cf3bb03ffd56e96f38bcdbb9163a0.tar.xz
nixlib-9ad22d35b67cf3bb03ffd56e96f38bcdbb9163a0.tar.zst
nixlib-9ad22d35b67cf3bb03ffd56e96f38bcdbb9163a0.zip
Revert "nixos/switch-to-configuration: remove explicit tmpfiles invocation"
-rw-r--r--nixos/doc/manual/development/what-happens-during-a-system-switch.chapter.md1
-rwxr-xr-xnixos/modules/system/activation/switch-to-configuration.pl4
-rw-r--r--nixos/modules/system/boot/systemd/tmpfiles.nix6
3 files changed, 5 insertions, 6 deletions
diff --git a/nixos/doc/manual/development/what-happens-during-a-system-switch.chapter.md b/nixos/doc/manual/development/what-happens-during-a-system-switch.chapter.md
index fa921bbc7c5e..ccadb819e061 100644
--- a/nixos/doc/manual/development/what-happens-during-a-system-switch.chapter.md
+++ b/nixos/doc/manual/development/what-happens-during-a-system-switch.chapter.md
@@ -37,6 +37,7 @@ of actions is always the same:
 - Forget about the failed state of units (`systemctl reset-failed`)
 - Reload systemd (`systemctl daemon-reload`)
 - Reload systemd user instances (`systemctl --user daemon-reload`)
+- Set up tmpfiles (`systemd-tmpfiles --create`)
 - Reload units (`systemctl reload`)
 - Restart units (`systemctl restart`)
 - Start units (`systemctl start`)
diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl
index b840c324e72b..e2f66a287bc4 100755
--- a/nixos/modules/system/activation/switch-to-configuration.pl
+++ b/nixos/modules/system/activation/switch-to-configuration.pl
@@ -889,6 +889,10 @@ while (my $f = <$list_active_users>) {
 
 close($list_active_users) || die("Unable to close the file handle to loginctl");
 
+# Set the new tmpfiles
+print STDERR "setting up tmpfiles\n";
+system("$new_systemd/bin/systemd-tmpfiles", "--create", "--remove", "--exclude-prefix=/dev") == 0 or $res = 3;
+
 # Before reloading we need to ensure that the units are still active. They may have been
 # deactivated because one of their requirements got stopped. If they are inactive
 # but should have been reloaded, the user probably expects them to be started.
diff --git a/nixos/modules/system/boot/systemd/tmpfiles.nix b/nixos/modules/system/boot/systemd/tmpfiles.nix
index 99928ab733d1..183e2033ecb0 100644
--- a/nixos/modules/system/boot/systemd/tmpfiles.nix
+++ b/nixos/modules/system/boot/systemd/tmpfiles.nix
@@ -150,12 +150,6 @@ in
       "systemd-tmpfiles-setup.service"
     ];
 
-    # Allow systemd-tmpfiles to be restarted by switch-to-configuration.
-    systemd.services."systemd-tmpfiles-setup" = {
-      unitConfig.RefuseManualStop = "no";
-      restartTriggers = [ "${config.environment.etc."tmpfiles.d".source}" ];
-    };
-
     environment.etc = {
       "tmpfiles.d".source = (pkgs.symlinkJoin {
         name = "tmpfiles.d";