All nix commands throw segfault

Hello, I’m having same issue as this user had few months ago.
This morning I woke my laptop from sleep, my screen locker (swaylock) didn’t allow any input (this has happened to me before), so I pressed the shutdown button (not holding it), the laptop shut down gracefully, but after booting, all my nix commands started throwing segfault, eg.:

$ nix --version
zsh: segmentation fault (core dumped)  nix --version

I have no idea what to do, I booted into live ISO, ran fsck (no errors reported), mounted my drives, ran nixos-install (no error, it installed just fine) but even that did not help.
Right now I wiped my root partition and completely reinstalled nix, hoping it was somehow a corruption in the store, but the result is still the same.
What’s weird is that in the live ISO, if I mount my drives & nix-enter, all of the nix commands work perfectly…

1 Like

Have you tried verifying the store to see if anything’s corrupted?

The nix-store --verify command also segfaults.

I mean in the installer :wink:

I’ve tried verify in the installer and everything seemed fine. I managed to get a solution from someone over at matrix, the problem was lqx kernel. Switching to regular kernel fixed my problem.

2 Likes

This happened to me too lately, for the second time. Last time (about a year ago) I believe it was also the lqx kernel. It seems a bit funky that a kernel can cause this kind of issue, and even more funky that only(???) nix is affected? (Could that mean that it’s still a bug in nix (e.g. a race condition or similar) that only manifests itself for certain kernel “optimisations”?)

1 Like