Skip to content
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

Merged
merged 3 commits into from Jan 6, 2024

Conversation

wiki-me
Copy link
Contributor

@wiki-me wiki-me commented Dec 31, 2023

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.

@edolstra
Copy link
Member

edolstra commented Jan 2, 2024

We should probably simplify this section by using nix upgrade-nix. That way you don't need to upgrade the nixpkgs channel.

@wiki-me
Copy link
Contributor Author

wiki-me commented Jan 4, 2024

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.

Copy link
Contributor

@fricklerhandwerk fricklerhandwerk left a 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.

doc/manual/src/installation/upgrading.md Outdated Show resolved Hide resolved
doc/manual/src/installation/upgrading.md Outdated Show resolved Hide resolved
@fricklerhandwerk fricklerhandwerk enabled auto-merge (squash) January 5, 2024 17:54
```
Remove old channel:

Check which Nix version will be installed:
Copy link
Contributor Author

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?

Copy link
Contributor

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"
Copy link
Contributor Author

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.

Copy link
Contributor

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.

@fricklerhandwerk fricklerhandwerk merged commit a4d33e8 into NixOS:master Jan 6, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants