Before I go and implement this myself, does anyone happen to have a nixos module in their config that configures their laptop such that it does not suspend when the lid is closed if it is on AC wall power?
This looks like a pretty clear description of how to do it, which could be adapted for NixOS: Prevent suspend on lid close with systemd – nrocco.github.io, but if anyone’s already done the work, I’d love to steal your work.