I disabled sleep after closing the lid using:
services.logind = {
rebootKey = "ignore";
rebootKeyLongPress = "ignore";
suspendKey = "ignore";
suspendKeyLongPress = "ignore";
hibernateKey = "ignore";
lidSwitch = "ignore";
lidSwitchExternalPower = "ignore";
extraConfig = ''
LidSwitchIgnoreInhibited=no
'';
};
Now when i close the lid, after 10-20 sec systemd-logind uses 30-40% cpu.
Lid open:
Lid closed: