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
Improve documentation around upgrading nix #9679
Conversation
We should probably simplify this section by using |
According to nix manual the command is experimental, I can't speak for others but I tend to prefer solutions that are mature and well tested. Also don't you need to explicitly enable the command? I think i did that some time ago but i can't find it now. |
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.
@wiki-me that's right, you have to enable the nix-command
experimental feature to use nix upgrade-nix
.
Given we don't have a good user story around upgrading Nix on regular Linux distributions, this documentation change is a net improvement, therefore I'm merging it with a few fixups.
A further improvement could be that @NixOS/nix-team reviews nix upgrade-nix
for stabilisation, so we can potentially get rid of the manual steps. There's a chance this will be an expensive endeavor though. The whole thing gives me a lot of headache every time I have to deal with it, because it exposes a lot of what I find wrong, broken, or not thought through.
``` | ||
Remove old channel: | ||
|
||
Check which Nix version will be installed: |
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.
It seems unclear why the nix version needs to be checked, is it because a "upgrade" might somehow lower the nix version?
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.
Yes, you should be aware which source you're getting Nix from. Software versions are a notion that only exists in users' heads.
|
||
```console | ||
$ nix-channel --remove nixpkgs | ||
$ nix-shell -p nix -I nixpkgs=channel:nixpkgs-23.11 --run "nix --version" |
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.
Wouldn't it be better to link to search.nixos.org? seems like a much faster option, you could also directly link to information about the package.
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.
I try to keep the Nix manual self-contained because most of the action happens somewhere else and at a different pace. Baking in things that may get out of date or out of sync is a source of confusion I'd very much like to avoid. One point of integration for documentation is nix.dev, where we point to search.nixos.org very early on.
All in all, as said in the other comment, I really don't like the vanilla upgrade story and given the lack of clearly superior approaches wouldn't want to spend too much energy on it right now.
Motivation
The instructions for upgrading nix are currently incomplete.
Context
A continuation of the debate around a bug in nix-channel
Priorities and Process
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.