nix-installer icon indicating copy to clipboard operation
nix-installer copied to clipboard

How to downgrade Nixpkgs to 23.05 on macOS?

Open dinvlad opened this issue 1 year ago • 3 comments
trafficstars

Hi folks,

I've just used the new graphical installer for macOS from https://determinate.systems/posts/graphical-nix-installer, which seems to have gone successfully. However, after installing Home Manager with

nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz home-manager
nix-channel --update
nix-shell '<home-manager>' -A install

it now complains with

$ home-manager switch
trace: warning: You are using

  Home Manager version 23.11 and
  Nixpkgs version 24.05.

How could I downgrade Nixpkgs to the stable version (23.11) so that I don't have this version mismatch?

Thank you

dinvlad avatar Dec 10 '23 21:12 dinvlad

@dinvlad Did you find any solution for this?

uhlajs avatar Jan 10 '24 12:01 uhlajs

I believe you can edit your extra-nix-path in Nix.conf:

extra-nix-path = nixpkgs=flake:nixpkgs:2305

As a side note, I recommend you try using home-manager via flakes! https://nix-community.github.io/home-manager/index.xhtml#ch-nix-flakes

Generally at Detsys we try to avoid mixing nix-channels with flakes. It can create some frustrating problems.

Hoverbear avatar Jan 10 '24 16:01 Hoverbear

@Hoverbear Modifying the extra-nix-path produce following error for nix-shell:

❯ nix-shell -p cowsay
error:
       … <borked>

         at «none»:0: (source not available)

       … while calling the 'import' builtin

         at «string»:1:18:

            1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (cowsay) ]; } ""
             |                  ^

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: input 'nixpkgs:2305' is unsupported

However, switching to flakes installation works perfectly. Thanks for tip!

uhlajs avatar Jan 12 '24 11:01 uhlajs