From fa41730b86df51d45465ef36d5dda8a5a898fbb5 Mon Sep 17 00:00:00 2001 From: nikstur Date: Sat, 25 Nov 2023 21:31:09 +0100 Subject: nixos/switch-to-configuration: remove explicit tmpfiles invocation --- nixos/modules/system/activation/switch-to-configuration.pl | 4 ---- nixos/modules/system/boot/systemd/tmpfiles.nix | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'nixos/modules/system') 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"; -- cgit 1.4.1