Improve messaging around version incompatability (#457)

* Improve messaging around version incompatability, suggesting how the user may address the situation

* Even better messaging

* Improve plan versioning messaging

* Remove note about /nix/nix-installer since it may not exist
This commit is contained in:
Ana Hobden 2023-05-17 10:29:47 -07:00 committed by GitHub
parent 1c18698ee6
commit 9de3c56c37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -395,7 +395,7 @@ fn ensure_version<'de, D: Deserializer<'de>>(d: D) -> Result<Version, D::Error>
Ok(plan_version)
} else {
Err(D::Error::custom(&format!(
"This version of `nix-installer` ({nix_installer_version}) is not compatible with this plan's version ({plan_version}), check for a compatible version at `/nix/nix-installer` or download the matching release from https://github.com/DeterminateSystems/nix-installer/releases",
"This version of `nix-installer` ({nix_installer_version}) is not compatible with this plan's version ({plan_version}), you probably are trying to install with a new version of `nix-installer` which is not compatible with version {plan_version} plans. To upgrade Nix, try `sudo -i nix upgrade-nix`. To reinstall Nix, try `/nix/nix-installer uninstall` then installing again from the instructions on https://github.com/DeterminateSystems/nix-installer. To continue using this plan, download the matching release from https://github.com/DeterminateSystems/nix-installer/releases.",
)))
}
}