lol

Merge pull request #251684 from jmbaur/user-activation-tmpfiles

nixos/systemd-user: call systemd-tmpfiles during activation

authored by

Florian Klink and committed by
GitHub
90204f05 06af5be0

+7
+4
nixos/modules/system/boot/systemd/user.nix
··· 230 230 }); 231 231 }) 232 232 cfg.tmpfiles.users; 233 + 234 + system.userActivationScripts.tmpfiles = '' 235 + ${config.systemd.package}/bin/systemd-tmpfiles --user --create --remove 236 + ''; 233 237 }; 234 238 }
+3
nixos/tests/user-activation-scripts.nix
··· 8 8 initialPassword = "pass1"; 9 9 isNormalUser = true; 10 10 }; 11 + systemd.user.tmpfiles.users.alice.rules = [ "r %h/file-to-remove" ]; 11 12 }; 12 13 13 14 testScript = '' ··· 27 28 machine.wait_for_file("/home/alice/login-ok") 28 29 verify_user_activation_run_count(1) 29 30 31 + machine.succeed("touch /home/alice/file-to-remove") 30 32 machine.succeed("/run/current-system/bin/switch-to-configuration test") 31 33 verify_user_activation_run_count(2) 34 + machine.succeed("[[ ! -f /home/alice/file-to-remove ]] || false") 32 35 ''; 33 36 })