Change:
# Get the set of currently packaged kernel versions. kernel_versions = {} <del> for filename in os.listdir(NIXPKGS_KERNEL_PATH): filename_match = re.fullmatch(r"linux-(d+).(d+).nix", filename) if filename_match: nix_version_expr = f""" with import {NIXPKGS_PATH} {{}}; (callPackage {NIXPKGS_KERNEL_PATH / filename} {{}}).version """ kernel_version_json = run( "nix-instantiate", "--eval", "--system", "x86_64-linux", "--json", "--expr", nix_version_expr, ).stdout kernel_version = parse_version(json.loads(kernel_version_json)) if kernel_version < MIN_KERNEL_VERSION: continue kernel_key = major_kernel_version_key(kernel_version) kernel_versions[kernel_key] = kernel_version </del> <ins> with open(NIXPKGS_KERNEL_PATH / "kernels-org.json") as kernel_versions_json: kernel_versions = json.load(kernel_versions_json) for kernel_branch_str in kernel_versions: if kernel_branch_str == "testing": continue kernel_branch = [int(i) for i in kernel_branch_str.split(".")] if kernel_branch < MIN_KERNEL_VERSION: continue kernel_version = [int(i) for i in kernel_versions[kernel_branch_str]["version"].split(".")] kernel_versions[kernel_branch_str] = kernel_version </ins> # Remove patches for unpackaged kernel versions. for kernel_key in sorted(patches.keys() - kernel_versions.keys()):

Discussion:
/dev/nvme0 becomes unavailable and causes / to unmount leading to an unresponsive system. <details<summarySmartctl output</summary</detailsNVMe + 6.5 kernel (either on main branch, staging-next branch, or staging-next + gnome branch) Not like this UnU <details<summaryError messages before rebooting</summary! ! </detailsRelated to Related to Related to Related to Related to <!-- 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. hw-probe: https://linux-
Already reported on NixOS discourse:
It's annoying to capture but finally managed to get more info ! !
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
Should we revert the patch mentioned here or wait for a new upstream kernel release?
Seems like 6.5.6-rc1 fixed the issue for me, still doing some testing. Besides the revert already on nixos there are 2 commits regarding nvme: a null pointer dereference, and something around no NUMA nodes and NVMe
nvm still crashing
Hey they fixed this one already. I believe y'all have a different bug. What machine is this on?
hw-probe: https://linux- 6 does seem like it did fix it.
Ok yes it's definitely a different bug (no realtek devices, no possible way it could be my bug). But I'm glad it's fixed I guess.
Still happens to me on 6.5.6. ! Symptoms are the same as reported by root filesystem is remounted as read-only, applications crash and system becomes unresponsive. PC must be forcefully shut down with the power button. This happens at least daily, and almost always while I'm away from the PC for a while, which makes the message "Does your device have a faulty power saving mode enabled?" sound like it's probably onto something. <details<summary<code$ nix-shell -p smartmontools --run "sudo smartctl -a /dev/nvme0"</code</summary</details
which machine is this?

I expect it's a firmware bug in the motherboard most likely.
My motherboard is: . I tried booting with the kernel parameters suggested in the error log now, hopefully that does something.
If you are using LUKS something that helped me reduce the frequency of errors (mitigation) was enabling triming (fstrim) in NixOS options Also, it seems like a relative new drive but has a very high warning temperature time; errors might be thermal related.
I don't use LUKS. The temperature warnings must be old, because I haven't caught the SSD go above 36 celsius in the current PC location, so I don't think the errors are temperature related. I let the PC sit over night with the suggested kernel parameters, and it hasn't crashed yet :crossed_fingers: