The solution isn’t as random when the issues that you’ve described (random freezes, caps lock flashing, …) are too close to the current problem to be a coincidence. Knowing that you use the proprietary drivers only confirms that.
As to how you can debug things further, I honestly have no idea. I’ve been running the 550.78 drivers with hardware.nvidia.powerManagement.finegrained = true; under X11 and I didn’t have any problems anymore, so I stopped messing with it. Some users reported that rolling back the drivers works, so you’re free to try that as well.
The nvidia-bug-report.sh script, which would probably help you collect more information is missing from NixOS, as well, which can make debugging harder.
That being said, if you’d still like to help, you should probably follow this thread on the Nvidia forum: