Change:
with lib; buildLinux (args // rec { <del> version = "6.4.15"; </del> <ins> version = "6.4.16"; </ins> # modDirVersion needs to be x.y.z, will automatically add .0 if needed modDirVersion = versions.pad 3 version;

Discussion:
I use tpm + luks, but recently when the kernel updating to 6.4.11, the can't find devices. And, if I switch to old kernel like 6.1, it can't work too. Steps to reproduce the behavior: the latest unstable work correctly. ! ! Add any other context about the problem here. <!-- Please @ people who are in the list of the offending package or module. If in doubt, check for whoever last touched something. --Please run and paste the result.
I have the same exact behavior with 6.4.11 and 6.1.46, however I am using Arch Linux. I imagine this is not a NixOS specific problem. Edit: likely relevant BZ
Same here with Fedora 38 after latest Kernel (6.4.11) update.
Same here with nixOS unstable and kernel version 6.1.46 with LUKS enabled for root partition.
Also on my cumputer
All bugfix patches will be backported to all maintenance branches, so the latest version of both the 6.4 and 6.1 branches has the same buggy commit. If you meet some bug and want to roll back to dig out the problem, you should roll back to the last working version you have used, rather than a version that looks older.
Ok, thanks
This exact error is happening on openSUSE too:
Out of curiosity, what hardware is everyone using? I thought this was causing my boot failure on my XPS 9560, but it turns out it was a different kernel bug causing boot to fail. My specs: XPS 9560 i7-7700HQ Not quite sure atm how to get TPM model.
Asrock z370 with i5-8600K The issue prevented me booting my Windows 11 VM (running as close to the "metal" as possible with GPU Passthrough) after updating to 23.05 (and emulated TPM doesn't work ootb). I had to manually apply the above referenced PR to my kernel last night after spending a number of hours tracking down the source of the problem (single-GPU passthrough makes this a bit difficult). After an hour or so compilation it was resolved. I'm sure there are others out there with issues that haven't identified what is causing it.

I'm using HP Gaming Pavilion - 15 with i7-9750H inside.
Hmm okay: My XPS 9560 boots fine with TPM decryption. Suspending and resuming does not got any errors with the TPM. My desktop with Ryzen 5950X and Asus Prime X570-Pro boots fine with TPM decryption. I do not have suspend enabled on that machine due it's home-server setup, so I cannot test.
I use i9-13900k, with TPM included in the CPU.
+1. My Fedora 38 NUC will no longer boot after 6.4.12 and this is the same error I see in the logs. The last working kernel I can boot into is 6.4.12. 6.4.13 and 6.4.14 just hang on boot.
Still happens to me under 6.4.15. Had to boot with 6.4.12.
I am sorry to reopen this issue but I have a very similar problem on nixos 23.11 on a Raspberry Pi 4. The module is not found on kernel 6.1.21.2023.0405 (the current version of linux_rpi4 in the nixos23.11 branch) As a workaround for now I am using the following code to allow missing kernel modules when rebuilding the kernel: I am not 100% sure that this is a nixpkgs issue, but I could not find any references to this problem on the Raspberry Pi 4 for now.
I'm using and , all seems good to me. Maybe it's something need to backport? I'm not sure if it's acceptable to discuss it here. If it's a rpi-4-only issue, maybe we should open a new issue and keep it quiet.