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

upgrade-nix downgrades, easy to miss readme comment #694

Open
dezren39 opened this issue Oct 28, 2023 · 6 comments
Open

upgrade-nix downgrades, easy to miss readme comment #694

dezren39 opened this issue Oct 28, 2023 · 6 comments

Comments

@dezren39
Copy link

image
hello! the determinate nix installer worked very well once i enabled systemd in wsl2.
i was following the steps and thought i'd upgrade just in case and it downgraded me :-)
https://github.com/DeterminateSystems/nix-installer?tab=readme-ov-file#upgrading-nix
i do see that the step does link and let you know where it comes from
https://raw.githubusercontent.com/NixOS/nixpkgs/master/nixos/modules/installer/tools/nix-fallback-paths.nix
and so maybe it's not an issue, but it may be a good idea to make a bigger bolder warning there if it's going to be a long-standing difference,
especially with notable flake issues with 2.17.0 and 2.18.1.

replacing old 'nix-2.18.1'
installing 'nix-2.17.0'
[user@DESKTOP-P1BL9NE ~]$ curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
info: downloading installer https://install.determinate.systems/nix/tag/v0.14.0/nix-installer-x86_64-linux
`nix-installer` needs to run as `root`, attempting to escalate now via `sudo`...
Nix install plan (v0.14.0)
Planner: linux (with default settings)

Planned actions:
* Create directory `/nix`
* Fetch `https://releases.nixos.org/nix/nix-2.18.1/nix-2.18.1-x86_64-linux.tar.xz` to `/nix/temp-install-dir`
* Create a directory tree in `/nix`
* Move the downloaded Nix into `/nix`
* Create build users (UID 30000-30032) and group (GID 30000)
* Setup the default Nix profile
* Place the Nix configuration in `/etc/nix/nix.conf`
* Configure the shell profiles
* Configure Nix daemon related settings with systemd
* Remove directory `/nix/temp-install-dir`


Proceed? ([Y]es/[n]o/[e]xplain): y
 INFO Step: Create directory `/nix`
 INFO Step: Provision Nix
 INFO Step: Create build users (UID 30000-30032) and group (GID 30000)
 INFO Step: Configure Nix
 INFO Step: Create directory `/etc/tmpfiles.d`
 INFO Step: Configure Nix daemon related settings with systemd
 INFO Step: Remove directory `/nix/temp-install-dir`
Nix was installed successfully!
To get started using Nix, open a new shell or run `. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh`

[user@DESKTOP-P1BL9NE ~]$ `. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
> ^C
[user@DESKTOP-P1BL9NE ~]$ . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
[user@DESKTOP-P1BL9NE ~]$ sudo -i nix upgrade-nix
replacing old 'nix-2.18.1'
installing 'nix-2.17.0'
building '/nix/store/b1vjgglfs4lji3016xklqvd9dbl8mv6b-user-environment.drv'...
[user@DESKTOP-P1BL9NE ~]$
@dezren39
Copy link
Author

maybe advertise
'if you're using flakehub, do not run this plain command, see this link to learn about'
https://flakehub.com/docs#upgrade-nix

@xd003
Copy link

xd003 commented Oct 30, 2023

i too noticed this problem

@Hoverbear
Copy link
Contributor

😅 This is not always the case, but indeed a better warning it a good idea.

@DanLipsitt
Copy link

The version file no longer exists, so the documentation is less clear now. See #928.

@DanLipsitt
Copy link

DanLipsitt commented Apr 10, 2024

maybe advertise 'if you're using flakehub, do not run this plain command, see this link to learn about' https://flakehub.com/docs#upgrade-nix

Oops, it looks like this document isn't there anymore either.

@DanLipsitt
Copy link

I was able to work around this by using the versions.nix from an earlier (but still newer than what I had installed) tag of the nix repo:

sudo -i nix upgrade-nix --nix-store-paths-url https://github.com/DeterminateSystems/nix/raw/v2.20.5/versions.nix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants