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

Failing to upgrade Nix on macOS #1400

Open
noghartt opened this issue Jan 27, 2025 · 1 comment
Open

Failing to upgrade Nix on macOS #1400

noghartt opened this issue Jan 27, 2025 · 1 comment
Labels
MacOS Darwin/MacOS

Comments

@noghartt
Copy link

Trying to upgrade my Nix binary to the new release (v2.25.4), but having this error:

> sudo -i nix upgrade-nix -vvv
found Nix in '/run/current-system/sw/bin'
error: Nix on NixOS must be upgraded via 'nixos-rebuild'

I'm running Nix on a macOS with nix-darwin. My current version is:

> nix --version
nix (Nix) 2.24.10
@noghartt noghartt changed the title Failing to upgrade Nix Failing to upgrade Nix on macOS Jan 27, 2025
@cole-h
Copy link
Member

cole-h commented Jan 27, 2025

This is likely because you're using nix-darwin (which mimicked NixOS's setup of using /run/current-system).

You should probably prefer to upgrade in whatever way they prefer (maybe their docs has a hint / instructions on this), but (not recommended and not tested) you may also be able to get around it if you specify a profile with nix upgrade-nix --profile ....

@cole-h cole-h added the MacOS Darwin/MacOS label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MacOS Darwin/MacOS
Projects
None yet
Development

No branches or pull requests

2 participants