about summary refs log tree commit diff
path: root/nixos/modules/system
diff options
context:
space:
mode:
authorBernardo Meurer <bernardo@meurer.org>2023-11-28 18:26:44 -0300
committerGitHub <noreply@github.com>2023-11-28 18:26:44 -0300
commitad1d3762bb1e2c68a8232da6a43e2998f1daa69f (patch)
tree51dc13127e15c5c4b4340c798550216957b082c4 /nixos/modules/system
parent34644e469092c82c37940c934160e6455d222cce (diff)
parentfa41730b86df51d45465ef36d5dda8a5a898fbb5 (diff)
downloadnixlib-ad1d3762bb1e2c68a8232da6a43e2998f1daa69f.tar
nixlib-ad1d3762bb1e2c68a8232da6a43e2998f1daa69f.tar.gz
nixlib-ad1d3762bb1e2c68a8232da6a43e2998f1daa69f.tar.bz2
nixlib-ad1d3762bb1e2c68a8232da6a43e2998f1daa69f.tar.lz
nixlib-ad1d3762bb1e2c68a8232da6a43e2998f1daa69f.tar.xz
nixlib-ad1d3762bb1e2c68a8232da6a43e2998f1daa69f.tar.zst
nixlib-ad1d3762bb1e2c68a8232da6a43e2998f1daa69f.zip
Merge pull request #269983 from nikstur/stc-tmpfiles
nixos/switch-to-configuration: remove explicit tmpfiles invocation
Diffstat (limited to 'nixos/modules/system')
-rwxr-xr-xnixos/modules/system/activation/switch-to-configuration.pl4
-rw-r--r--nixos/modules/system/boot/systemd/tmpfiles.nix6
2 files changed, 6 insertions, 4 deletions
diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl
index e2f66a287bc4..b840c324e72b 100755
--- a/nixos/modules/system/activation/switch-to-configuration.pl
+++ b/nixos/modules/system/activation/switch-to-configuration.pl
@@ -889,10 +889,6 @@ 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 183e2033ecb0..99928ab733d1 100644
--- a/nixos/modules/system/boot/systemd/tmpfiles.nix
+++ b/nixos/modules/system/boot/systemd/tmpfiles.nix
@@ -150,6 +150,12 @@ 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";