Can't downgrade back from unstable to 23.05 (flake)


Recently I’ve switched from 23.05 to unstable. I’m trying to go back but I keep getting an error that I don’t know how to fix :frowning:

I’ve tried sudo nix flake update, sudo nix-collect-garbage -d and sudo nixos-rebuild switch --flake '<path>/.#nixos' without success.

I have this in my flake.nix

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; # was unstable for a couple weeks
    impermanence.url = "github:nix-community/impermanence";
    home-manager.url = "github:nix-community/home-manager";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";

After committing every file in my config repo (to avoid the dirty warning) and running the nixos-rebuild command, I’m getting:

building the system configuration...
       … while calling the 'head' builtin

         at /nix/store/7k8b7jmwa2vd52hjby4z1s6p00ifvbkr-source/lib/attrsets.nix:816:11:

          815|         || pred here (elemAt values 1) (head values) then
          816|           head values
             |           ^
          817|         else

       … while evaluating the attribute 'value'

         at /nix/store/7k8b7jmwa2vd52hjby4z1s6p00ifvbkr-source/lib/modules.nix:759:9:

          758|     in warnDeprecation opt //
          759|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          760|         inherit (res.defsFinal') highestPrio;

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

       error: eza cannot be found in pkgs

After this, anytime I re-run the nixos-rebuild command, I have this error:

building the system configuration...
error: cached failure of attribute ''

But if I run rg eza to check if I have missed removing eza, nothing is found in my config files.

For the record, I was on stable with exa installed for months. Then I switched to unstable, exa being deprecated recently, I used the new project eza (which is not in 23.05 channel).

But now I’m stuck with this error. I thought switching channel would be pain free but apparently, it’s more complex than I thought and I don’t know what to do. I’ve searched in the wiki, reddit, etc…

Thank you for any help! I’m stuck for days.

I think you should also downgrade home-manager to use the 23.05 branch. In general, HM is tightly linked to nixpkgs.

There’s probably a reference to eza in HM.

Update the flake input to github:nix-community/home-manager/release-23.05.


It so obvious now that you say it! I can’t thank you enough, it was the solution :smiley: