Userspace sometimes unrecoverably hangs on high disk usage

Making a small update here. I finally figured out the issue. Early on I discounted swap being the issue as this was happening also before I enabled swap.

Turns out encrypted swapfiles can be iffy on NixOS. Disabling the encryption fixed it instantly. It took me an embarrassing amount of time to realise this… I think the reason why I thought it was also happening before I added swap is that I probably used to have OOM issues that were resolved with swap but causing another issue that manifests very similarly.