Nixos-install failing

It has been a while since I did a new nixos install. Can anyone help me debug this?

cannot build derivation '/nix/store/j2dzdhcxn7y44gn4jdnsdfcipisj2bz6-system-path.drv': 1 dependencies couldn't be built
copying path '/nix/store/1446fxf950czy7achdxm5c51ql6y2cpn-initrd-kmod-blacklist-ubuntu' to 'local'...
copying path '/nix/store/7xp1yxk8d67ik4rfcbxxjrfv6fnch0p5-iana-etc-20210225' to 'local'...
cannot build derivation '/nix/store/3i0l6gvakx99knwzmkz7zpxj0yj2v28s-nixos-system-btrfs-test-21.05.1076.bad3ccd099e.drv': 1 dependencies couldn't be built
error: build of '/nix/store/3i0l6gvakx99knwzmkz7zpxj0yj2v28s-nixos-system-btrfs-test-21.05.1076.bad3ccd099e.drv' failed

I don’t even have a clue where to start.

When this happens to me the culprit is usually further back up the trace. And it’s usually just a bad package that is failing to build. Scroll further back and see if you can identify the bad package, comment it out in your configuration.nix, and try again.

There’s a good chance it’s this bug: nixos-install fails with getting attributes of path /nix/store/...: No such file or directory · Issue #126141 · NixOS/nixpkgs · GitHub

No, that failure is pretty early on, there are no failures above it.

Thanks for the pointer, it could be that.

I tried the workaround posted by @jonringer

nix-build '<nixpkgs/nixos>' -A config.system.build.toplevel -I nixos-config=/mnt/etc/nixos/configuration.nix

However, since that writes to /nix-store, it fills up the overlay filesystem before it can complete.

1 Like

OK, I mounted a permanent filesystem to /nix/store and the workaround did solve the problem. I guess this means that my issue was indeed that bug.

On the one hand, it sucks when you hits bugs. On the other, at least it wasn’t something I was doing wrong. :nerd_face:

Thanks for the help!

EDIT: It occurs to me that, for my use case, a much simpler workaround would have been to install a minimal configuration.nix and then switch to my real one post install. :face_with_monocle:

2 Likes

That’s exactly what I did and it worked.

1 Like