switch-to-configuration-ng: clear environment when reexecing as user

Avoids weird magic dbus variables leaking in and ruining everything.
This commit is contained in:
K900 2024-09-06 19:52:56 +03:00
parent a06868fb0d
commit c80b166115

View File

@ -1678,6 +1678,7 @@ won't take effect until you reboot the system.
std::process::Command::new(&myself)
.uid(uid)
.gid(gid)
.env_clear()
.env("XDG_RUNTIME_DIR", runtime_path)
.env("__NIXOS_SWITCH_TO_CONFIGURATION_PARENT_EXE", &myself)
.spawn()