Random suspends after wakeup from suspend and login on GNOME

Logging into my account after suspension causes forced suspend after a few seconds.

I am a newbie in NixOS and am trying to run GNOME install of NixOS with the non-free Nvidia drivers (GTX1050ti), because the nuveau driver caused awful screen tears and lagged. I have followed the steps in the docs related to Nvidia and had to set powerManagement.enable = true; because otherwise I would get graphical corruption after waking from suspend. I don’t believe I have changed anything else since, but it is possible because I have not noticed this issue until a few days later when I had to suspend and wake the PC. The issue is, that once I suspend my machine and then try to wake it up it runs normally until I log in to my user session. Then after a few seconds Firefox freezes and I get a prompt allowing me to force quit it. After a few more seconds the screen turns black, I see the login screen and then the system goes to suspend. This cycle happens several times before I can regularly use the computer for as long as I don’t suspend again.
My configuration.nix and log from journalctl from today which captures my suspend and then two error suspends.