Home-Manager doesn't work anymore after `nix-channels --update`

After I did an update of the channels, I do see the following output on running home-manager switch or build (verbose):

error: while evaluating anonymous function at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/top-level/impure.nix:15:1, called from /home/nmelzer/.nix-defexpr/channels/home-manager/home-manager/home-manager.nix:1:10:
while evaluating anonymous function at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/top-level/default.nix:20:1, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/top-level/impure.nix:84:1:
while evaluating anonymous function at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/stdenv/booter.nix:42:1, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/top-level/default.nix:108:10:
while evaluating 'dfold' at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/stdenv/booter.nix:60:27, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/stdenv/booter.nix:136:4:
while evaluating 'go' at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/stdenv/booter.nix:63:18, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/stdenv/booter.nix:72:13:
while evaluating 'folder' at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/stdenv/booter.nix:89:33, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/stdenv/booter.nix:68:18:
while evaluating 'allPackages' at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/top-level/default.nix:98:17, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/stdenv/booter.nix:101:12:
while evaluating anonymous function at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/top-level/stage.nix:12:1, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/top-level/default.nix:98:26:
while evaluating 'fix' at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/lib/fixed-points.nix:19:9, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/top-level/stage.nix:248:3:
while evaluating 'extends' at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/lib/fixed-points.nix:69:24, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/lib/fixed-points.nix:19:20:
while evaluating 'extends' at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/lib/fixed-points.nix:69:24, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/lib/fixed-points.nix:69:42:
while evaluating 'extends' at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/lib/fixed-points.nix:69:24, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/lib/fixed-points.nix:69:42:
attempt to call something which is not a function but a list, at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/lib/fixed-points.nix:69:67
error: while evaluating the attribute 'activationPackage' at /home/nmelzer/.nix-defexpr/channels/home-manager/modules/default.nix:46:3:
while evaluating 'showWarnings' at /home/nmelzer/.nix-defexpr/channels/home-manager/modules/default.nix:16:18, called from /home/nmelzer/.nix-defexpr/channels/home-manager/modules/default.nix:31:12:
while evaluating anonymous function at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/top-level/impure.nix:15:1, called from /home/nmelzer/.nix-defexpr/channels/home-manager/home-manager/home-manager.nix:1:10:
while evaluating anonymous function at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/top-level/default.nix:20:1, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/top-level/impure.nix:84:1:
while evaluating anonymous function at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/stdenv/booter.nix:42:1, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/top-level/default.nix:108:10:
while evaluating 'dfold' at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/stdenv/booter.nix:60:27, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/stdenv/booter.nix:136:4:
while evaluating 'go' at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/stdenv/booter.nix:63:18, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/stdenv/booter.nix:72:13:
while evaluating 'folder' at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/stdenv/booter.nix:89:33, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/stdenv/booter.nix:68:18:
while evaluating 'allPackages' at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/top-level/default.nix:98:17, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/stdenv/booter.nix:101:12:
while evaluating anonymous function at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/top-level/stage.nix:12:1, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/top-level/default.nix:98:26:
while evaluating 'fix' at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/lib/fixed-points.nix:19:9, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/pkgs/top-level/stage.nix:248:3:
while evaluating 'extends' at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/lib/fixed-points.nix:69:24, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/lib/fixed-points.nix:19:20:
while evaluating 'extends' at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/lib/fixed-points.nix:69:24, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/lib/fixed-points.nix:69:42:
while evaluating 'extends' at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/lib/fixed-points.nix:69:24, called from /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/lib/fixed-points.nix:69:42:
attempt to call something which is not a function but a list, at /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe/nixpkgs/lib/fixed-points.nix:69:67
/home/nmelzer/.nix-profile/bin/home-manager: line 115: /tmp/home-manager-build.bGl5uIWViO/news-info.sh: No such file or directory

As I am unable to find a reference to home.nix in there, I assume the problem is even before my configuration is loaded.

My other computer (which uses unstable channel) has basically the same symptom, though there nixpkgs-20.03 is mentioned instead.

Is there something I can do to debug into this, or is all I can do to file a bug and wait? Or even more important, is there a way to prevent this to happen again?

Also as a side question, can I revert the channel update?

nix-channel --rollback
1 Like

Thanks!

Though it seems unrelated. I rolled back as far as possible, none of the available generations was able to build, all failed with the same error.

So my assumption is, that also home-manager has updated and this is causing the actual issue… Sadly there is no (obvious) way to check version of home-manager…

Well, a nix-channel --rollback will only roll back the channel to an earlier version, not your current software. You will have to either nixos-rebuild switch or figure out the exact generation you want to go back to and run the bin/switch-to-configuration script as needed, for example something like this:
# /nix/store/gm91frsv5zyg72vzvgdqsssbng6n4hgn-nixos-system-nixos-19.09.1863.81101ce9d12/bin/switch-to-configuration

Unless you’ve been using nix-env -i to install software, for that you need to use nix-env --rollback as necessary.

1 Like

I’m not using nixOS, but only nixpkgs on top of archlinux, and there is not a single nix-env installed package.

Everything is from home manager (which also manages itself) or a projects nix-shell.

I just tried to move to the oldest available home-manager generation and not even from there home-manager seems to work. I do get the very same error as above, plus/minus the current channel version.

Though I just checked nix-env -q --installed, it lists at least home-manager-path, though I think this is necessary to have home-manager work.

I suggest you try nix-env --list-generations and nix-env--rollback to see if that sorts out your problem with home-manager and gives you an older version that still works.
I’m not using home-manager, so I cannot really advise you on those things specific to home-manager.

1 Like

Okay, I rolled back as far as my available generations are reaching (~14d). All of them have the same problem…

@rycee any hints?

For HM it’s sort of similar. The switch to a specific generation would be done by running

/nix/store/[…]-home-manager-generation/activate

You can find out which Nix store path corresponds to which HM generation by running

$ home-manager generations

I rolled back to the oldest available generation as well. No chance in behaviour.

PS, to be really sure, I even replaced my home.nix with the empty config as in {}.

Did the Nixpkgs store path change in the error message when you rolled back Nixpkgs? Or does it still say

 /nix/store/mnh09db9srfkzrqngvxm8z70irawad62-nixpkgs-19.09.1850.5dc4d071ffe

?

Also, do you have any overlays active?

…As I rolled back and forth through nix-channel, nix-env and home-manager I’m not sure, but when I now do roll back to my “latest” generation of the channels, I see 19.09.1850.5dc4d071ffe, if I then rollback to the oldest, I see 20.03pre207249.7e8454fb856.

I checked this on the computer I have physical access to, not my remote machine. I can’t reach it via SSH right now.

Peculiar. As far as I can tell from the original error message the error arises from simply evaluating import <nixpkgs> {}. Could you check if you get an error if you run

$ nix eval '(import <nixpkgs> {}).lib.version

?

Yepp, that already has the same error.

Cool, that’s good. I was able to reproduce the same error message (and trace) by adding a file ~/.config/nixpkgs/overlays/repro.nix containing

[(self: super: {})]

when it should be a plain function like

self: super: {}

Do you have anything similar anywhere?

1 Like

Ouch!

Probably…

I mv my former ./nix-folder to be ./overlays, as it read just better in the source. Now that you are saying… And the default.nix in that folder just returns a list of overlays…

Let me check if renaming this helps…

Yes, that was the problem, renaming that folder to overlay_list makes everything work again.

So the channel update was co-incidental and not causal… I just didn’t did two things at once and finger pointed at the wrong one…

Though now I have the next error, as I just realize:

$ home-manager build
error: attribute 'flavors' missing, at /home/nmelzer/.nix-defexpr/channels/home-manager/modules/services/gpg-agent.nix:134:41
(use '--show-trace' to show detailed location information)

There is an unread and relevant news item.
Read it by running the command 'home-manager news'.

$ cat home.nix 
{}

That’s because you are using the master branch of Home Manager with a stable branch of NixOS/Nixpkgs. You need to switch to the corresponding stable branch of Home Manager, currently release-19.09.

No, I need to switch back to the unstable channel of nixpkgs :wink: but thanks for the hint.