forked from lix-project/lix-installer
Correct the detection of an existing Nix installation.
It turns out this detection is completely ineffectual for most users, because of our elevation with sudo. We forcibly remove Nix from the environment! utm@utm:~$ sudo env SHELL=/bin/bash nix + sudo env SHELL=/bin/bash nix env: ‘nix’: No such file or directory This means that people have been able to reinstall Nix overtop Nix for some time... I've done that at least once today? Should that be allowed? Are they causing themselves harm? I don't know, and am open to input on this question. Anyway, if we do want to prohibit this we can... is this a better test? How thorough do we want our test to be?
This commit is contained in:
parent
41a96f49fc
commit
f59b5b4d89
|
@ -203,14 +203,7 @@ pub(crate) async fn detect_selinux() -> Result<bool, PlannerError> {
|
|||
}
|
||||
|
||||
pub(crate) async fn check_nix_not_already_installed() -> Result<(), PlannerError> {
|
||||
// For now, we don't try to repair the user's Nix install or anything special.
|
||||
if Command::new("nix-env")
|
||||
.arg("--version")
|
||||
.stdin(std::process::Stdio::null())
|
||||
.status()
|
||||
.await
|
||||
.is_ok()
|
||||
{
|
||||
if Path::from("/nix/var/nix/profiles/default/bin/nix").exists() {
|
||||
return Err(PlannerError::NixExists);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue