New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide correct instructions how to upgrade Nix without nixpkgs. #17631
Conversation
@domenkozar, thanks for your PR! By analyzing the annotation information on this pull request, we identified @edolstra, @ebzzry and @Ericson2314 to be potential reviewers |
This seems to duplicate these paths in
Also would be better to figure out a way to automate that, like |
Or how about this: Hydra publishes a tarball to a canonical URL with a single nix file in it containing a string with the instructions in it. Then this default.nix calls |
That requires Hydra to be online while currently you just need cache.nixos.org to be there and I've never seen it down. |
@domenkozar does it? I'm just saying Hydra uploads a file to a canonical URL (it could be anywhere for all I care) after a successful build, just like it updates channels on nixos.org. |
@copumpkin for example https://nixos.org/releases/nix/latest/? I'm +1 doing this more automated, but let that be second iteration :) |
Yeah, that. Definitely fine to do this for now, just don't want to have long-term instructions that will rot and mislead newbies 😄 |
Removing dependency on wiki is exactly one step to that goal :) Fully agreed. |
808d3bb
to
230fed5
Compare
One thing I've noticed, it's possible to install Nix for the wrong platform and completely break it. cc @edolstra |
Now that you point that out, @domenkozar, it seems like with the thing I'm describing, the tarball could contain one attribute per Again, not something we need to do now, but it'll cut out one potential human screwup eventually 🐱 |
@copumpkin good idea, I've now refactored that to print
|
a291e7a
to
7f32259
Compare
$ nix-env -i ${getAttr currentSystem platformPath} | ||
'' else '' | ||
Your platform ${currentSystem} doesn't have a binary cache. Please | ||
reinstal Nix following instructions on http://nixos.org/nix/download.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*reinstall
7f32259
to
f1fead5
Compare
If there are no objections from @edolstra I'll merge this tomorrow. |
I don't think this is a good idea, because how to upgrade Nix is system-dependent. E.g. on NixOS, installing Nix via nix-env will cause interference with the version installed in the system profile. Likewise when Nix is installed via RPM/apt. Also, this duplicates the store paths in Maybe we should just remove the wiki link? |
@edolstra doesn't I think it's common for folks not to upgrade Nix (non-nixos) and we have to have a way for them to do so when nixpkgs requirement is bumped. Maybe Nix should have some autoupgrading logic in there? Or at least warn that newer version is around. For example pip (python installer) checks for newer versions on invocations and caches that for a while:
I think this PR is "good enough" until we find a better way. It's very important for Nix installation/usage not to introduce blockers since that gives people a sense of unstable package manager, leaving them in the paradox. |
@edolstra I've run into several people who have encountered the "nix is too old" message, and have even found the current wiki page confusing or misleading. Making that experience worse for them seems like the wrong direction. |
A tiny bit out of context, but here is @edolstra feedback:
I'll fix 1) and look into 2). |
@domenkozar (I'm very late): |
From the manual it seems that the bash-curl method is far the easiest way to get nix onto a Linux or Darwin machine: http://nixos.org/nix/manual/#ch-installing-binary I'd think in that case it's enough to perform upgrades of nix itself by |
Feedback requested on IRC: Situation:
Working solution provided on IRC:
|
For the long-term solution see NixOS/nix#1113, I'd still merge something like this for short-term. |
I don't think the current proposal will work on NixOS, because you can get into problems where the nix-daemon is running a too old version and just using a newer nix evaluator doesn't help. How about something more along these lines:
|
This one doesn't seem to be progressing. I'm closing this and implemented my suggestion above in #24017. |
See #15344 NixOS/nix#1021