Slow, erratic performance after laptop lid closes

Hello, I bought a Thinkpad and put NixOS on it last year.
I thought it had weird performance issues and I’ve figured out what causes it - just locking the screen by closing the lid.

Youtube videos will stutter, audio will be choppy, game FPS counters will drop from 700 to 160 and visually look more like 35.

It runs beautifully on first boot and does boot quickly but I can’t shut the lid. I’ve tried using the brightness dim tool but that doesn’t turn the monitor bright ness all the way off.

I haven’t explicitly set zfs to scrub on lock, but if it was scrubbing I thought it would be done faster than 15 minutes? The computer seems to never recover from this broke state and I have to reboot for performance.

My desktop NixOS runs fine - lock screen or no!