My laptop completely freezes sporadically. The display stops updating, keyboard and mouse do not do anything. The laptop gradually heats up and the fan speed ramps up to max and stays there for as long as it stays on.
I cannot switch to another TTY; the only thing I can do is toggle between the three keyboard backlight modes with the function key. In order to keep using the system, I have to hard power off by holding the power button for ten seconds.
Often, the freezes happen multiple times in a row.
Freezing appears to be only loosely correlated with resource usage and system load. It happens while editing documents, watching YouTube, running VMs, or playing Minecraft. It also seems to be heat related in some way, as it is more common on hot days (30+ degrees Celsius).
It also occurred on Fedora, so it is not NixOS specific, but it does not happen on Windows (booting from a USB SSD). The problem has occurred on two different NVMe internal SSDs.
EDIT: I think every system where it happens has used btrfs, so that could be related to the issue somehow.
It occurs with or without my mouse plugged in, with zstd btrfs compression on or off, on Wayland and Xorg.
My NixOS config: GitHub - mars-monkey/nix
My hardware: https://linux-hardware.org/?probe=ae203f3797
I am not very experienced at reading logs, but I did try journald and GNOME Logs, and I did not see anything.
While it does not appear to be nix related, I would very much appreciate any help.