Can I downgrade to Nix 2.3 after using the newest Mac installer?

I’m currently using Nix 2.3 on macOS Mojave (10.14). I know the Nix installation process got kind of complicated starting with Catalina (10.15), and I was really happy to see that the manual now says that “we believe we have ironed out how to cleanly support the read-only root on modern macOS.”

I’m going to be getting a new Mac soon, which will come with Monterey (12.x). Naturally, I want to use the latest and greatest Nix installer to get Nix onto the machine. However, I found Nix 2.4 to be too big of a change for me—nix search stopped working until I enabled Flakes, for example, and that led to its own set of problems.

If I install Nix on my Monterey machine, will it then be possible to downgrade to Nix 2.3.x? If so, how? Or does the new installation process set things up in a way that is only comprehensible to Nix 2.4 or 2.5?

I’m not sure about the actual mechanics of using the earlier Nix CLI and daemon (it’ll also depend a little on how you’re managing it), but I can at least speak to the mac-specific installation bits: none of them should have a hard dependency on a specific Nix version.

That’s great, thanks! Do you happen to know whether there are any dependencies the other way—whether Nix 2.3 cares about the details of the installation? (Or, more to the point, whether those details have changed between 2.3 and 2.5?)

It shouldn’t (at least, not the bits about the macOS install that changed).

(I’m being a little cagey in focusing on those bits because I worked on them–but I’m not 100% certain what all else has changed over time. I would be surprised if it didn’t work just fine, but I haven’t tried it.)

It wouldn’t be quite the same as trying it on a new Monterey M1, but if you’re curious about the broad strokes you could probably set up a github-actions job using install-nix-action, then explicitly install an older Nix with nix-env, and build something

1 Like

I just tried the approach the OP is asking about, and the main thing I’ve noticed is that I don’t get full build logs anymore. I get ‘the following derivations will be built’ and a list of the derivations, but then no further output (although the derivations are still built). Do you have any advice on debugging this?

Sorry for the anticlimactic follow-up, but in the end I figured out how to live with Nix 2.5. I didn’t try to downgrade at all.

(If it helps anyone else, the changes I needed to make were to (1) update my zshenv file to handle the possibility that $NIX_PATH is not set; (2) add

experimental-features = nix-command flakes

to my nix.conf file; and (3) change how I was calling nix search in my custom Nix wrapper script. In particular, I needed to change nix search query_goes_here to nix search nixpkgs query_goes_here, and I needed to stop calling nix search --update-cache.)

I don’t have any advice on this, sorry! You might want to start a new thread.