So recently there’s been an update to how the kernel is built for NixOS that forces something something something certificates–I’m far from being an expert on kernel stuff.
This broke a number of modules, including openrazer which I need to use my mouse.
Here’s an issue mentioning some of those packages: nixpkgs#575192: linux: aggregateModules fails when external kernel modules lack .ko.cer files
BUT, and here’s where things get sad, I couldn’t manage to get it working.
All my attempts to import the patch ended on a kernel panic that landed me into recovery mode on system activation.
I tried these:
(I normally use Xanmod but did try mainline Linux to see if Xanmod was in cause but nope.)
I’ve also tried downgrading from nixpkgs-unstable to nixpkgs-26.05 but then the open source NVidia drivers’ build errors out so I don’t even reach the system activation phase.
Artemis is the only host using this config for now but I’ll be setting up my laptop at some point so there’s already an implementation of multi-host, hence the config being split between common and artemis.
I had a similar issue with a different driver, you only need to rebuild openrazer the way #576293 does, on top of your existing boot.kernelPackages.
Please try this after removing the applyPatches / import block and the boot.kernelPackages = nixpkgs-576293 line, then add this to your artemis host module (inside the mkIf):
Tried and it panicked just like all the other attempts. I pushed the version of my flake with your solution on the kernel-panic branch.
Also, I did it after a fresh boot and ran journalctl -xb > /home/wrexes/journal from recovery after crashing. Might be of some help, who knows?
Had to make a Gist because that thing is HUGE.
Gotta admit it looks just slightly less like a jumbled mess with the colours from the journal.
I see a lot of pipewire/pulse/alsa things, I’m not entirely sure they are irrelevant because one thing that seems to always happen right before the kernel panic is the audio cutting out and the speaker icon in my taskbar getting barrd four a couple seconds, despite audio never cutting out before during a test/switch.
The Unterminated quoted string: "/home/wrexes/.config/nixos is very odd because I did make sure to properly quote everything, and I did look for every mention of this path (or config.flake.root - custom module) and all is fine so I have no clue what’s happening there.
And of course there’s a couple walls of errors relating to udev and Razer things.
for whatever it’s worth, i don’t have an XDG document portal cache fs explicitly declared in my hardware config anywhere and it seems to be automatically mounted with user permissions as a subprocess of the /etc/systemd/user/xdg-document-portal.service unit.
not sure if it’s applicable to your situation, but might give you something to go on.
I just did, after disabling nearly everything (including NVidia drivers and OpenRazer) but KDE and a couple CLI essentials like git, fd, ripgrep… And it booted me straight into recovery.
What’s weirder is that among my attempts, at some point I managed to get a VM working. But my tower’s was still cooked for this generation.
i’m not seeing a kernel panic (?) in there.
To be fair, I assumed that’s what it was because I had issues with kernel modules and the only times I got sent to recovery so abruptly before was because of panics… But given that I managed to get a VM working with an updated flake I’m thinking yeah it has to be something else.
Interestingly enough, I’m not seeing this fusefs entry in the fstab of the working generation I’m using… Nor does it appear in anterior versions of the generated hardware config–I did re-generate it at some point, can’t even remember why.
Might’ve been a transitive thing that got saved by the generator script.
I’m going to get rid of it, see how it goes.
Edit: Same thing, it threw me into recovery on a nixos-rebuild test.
Okay. My bad for blaming <nixpkgs>.
It turns out the mistake came from between the monitor and the chair, as usual, and the fix was so simple that I’m ashamed–but I learned something!
See, I was still quite puzzled by theselinesinmyjournal–these last three being actually pretty revealing of the issue, in retrospect.
So I decided to run a dumb sudo rg -F '"/home/wrexes/.config/nixos" / and see what files came up. Sure enough, some PAM configs did appear in the results.
So… environment.sessionVariables sets variables that are evaluated during PAM init, and stores its values inside a config file that is sourced during the very early stages of boot/sysinit.
This file looks very much like POSIX shell syntax, but isn’t really.
The fact is that it’s a list of key=value pairs with a comment feature, for which the prefix is #.
But PAM environment doesn’t care that it’s quoted or not, and doesn’t support any form of escaping. If it’s got a hash sign, it’s a comment. Period.
Now, around the same time I updated my flake inputs and stumbled upon this openrazer driver issue, I added some simple environment variables for convenience, namely NH_OS_FLAKE, to be able to use the nh os ... commands anywhere without having to cd into my flake directory and having to specify the whole .#<host> thing with it.
And so I ended up with this, which in turn lead PAM init to stop at the hash sign and discard the rest, creating a fatal failure condition.
This very low level process crashing, the system halted initialisation and threw me into recovery.
The solution simply was to put it inside environment.variables and I feel silly now.
Thanks for your help, and sorry for wasting your time with a misleading title, I suppose? Have a good day~