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

Upgrading nix suggest nix upgrade-nix #7794

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lemastero
Copy link

Motivation

After attempt to update multi-user Nix on macOS using:

sudo -i sh -c 'nix-channel --update && nix-env -iA nixpkgs.nix && launchctl remove org.nixos.nix-daemon && launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist'

it did not work.

Running:

nix upgrade-nix

solved the problem.

Context

Checklist for maintainers

Maintainers: tick if completed or explain if not relevant

  • agreed on idea
  • agreed on implementation strategy
  • tests, as appropriate
    • functional tests - tests/**.sh
    • unit tests - src/*/tests
    • integration tests - tests/nixos/*
  • documentation in the manual
  • code and comments are self-explanatory
  • commit message explains why the change was made
  • new feature or incompatible change: updated release notes

@@ -4,7 +4,8 @@ Multi-user Nix users on macOS can upgrade Nix by running: `sudo -i sh -c
'nix-channel --update &&
nix-env -iA nixpkgs.nix &&
launchctl remove org.nixos.nix-daemon &&
launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist'`
launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist'`
If this does not work try: `nix upgrade-nix`.
Copy link
Member

@edolstra edolstra Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably remove the old instructions if they don't work. However, I guess nix upgrade-nix does still require launchtl calls. It would be nice if it did that automatically...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old instructions did not worked for me. I assume it might be issue specific to my env.
Perhaps old way works for other people 🤔

The docs for nix upgrade-nix say:

Warning
This program is experimental and its interface is subject to change.

That is why I thought adding this as alternative is a good idea.

WDYT @edolstra?

@fricklerhandwerk
Copy link
Contributor

A question I couldn't find an answer for myself, excuse me if this is off topic, but it may be pertinent:

Why does such a command exist in the first place? Is it made for a world where package management is imperative? Because in all of the ecosystem's declarative configuration managers, you'd update your environment to have a newer Nix, symlink that and be done. Or am I badly misunderstanding something?

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/tweag-nix-dev-update-44/25546/1

@fricklerhandwerk
Copy link
Contributor

fricklerhandwerk commented Feb 20, 2023

Triaged in the Nix team meeting 2023-02-17:

  • @edolstra: the vast majority of users don't use NixOS
    • @fricklerhandwerk: my point is that probably a vast majority uses some kind of declarative config
  • @edolstra: the problem underlying this PR will be resolved will go away when the CLI is stable
    • (vigoruous discussion around what that would entail)
  • to discuss in order to clarify underlying issues

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2023-02-17-nix-team-meeting-minutes-33/25624/1

@fricklerhandwerk
Copy link
Contributor

fricklerhandwerk commented Feb 28, 2023

Discussed in the Nix team meeting 2022-02-27:

  • @thufschmitt: nix upgrade-nix is experimental
  • (some philosophising on the notion of self-upgrading)
  • @Ericson2314: the manual on installation and upgrading needs general overhaul
  • agreement: postponed, this is not a priority

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2023-02-27-nix-team-meeting-minutes-36/25890/1

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.

4 participants