Monitor shutting down on my main screen when I close the lid

Hi,

When I close the lid of my laptop the monitor shuts off. I am using Plasma 6, nixos 24.05 and this is what I set up as option:
services.logind = {
extraConfig = ‘’
HandleLidSwitch=ignore
‘’;
};

services.upower = {
enable = true;
ignoreLid = true;
};

after I run “nixos-rebuild switch --flake .” and restart the system, the systemd file are still the same as before in “logind.conf”:

[Login]
KillUserProcesses=no
HandlePowerKey=poweroff
HandlePowerKeyLongPress=ignore
HandleRebootKey=reboot
HandleRebootKeyLongPress=poweroff
HandleSuspendKey=suspend
HandleSuspendKeyLongPress=hibernate
HandleHibernateKey=hibernate
HandleHibernateKeyLongPress=ignore
HandleLidSwitch=suspend
HandleLidSwitchExternalPower=suspend
HandleLidSwitchDocked=ignore
HandleLidSwitch=ignore

Any idea why?

Thanks

Sorry. I’m not familiar with configuring this behavior. Why are both upower and logind involved? Shouldn’t it be a single service that provides this behavior?

Maybe…regardless, the modifications I did in configuration.nix should reflect on the file but this clearly is not happening, that is my biggest issue

Maybe try setting this option instead :

services.logind.lidSwitch = "ignore";

instead of the extraConfig.

It seems like the basic configuration is done outside extraConfig which only counts for extra things that arent options : go see the NixOs Search Options website for the available options.

thanks, I updated to unstable and it does seem the issue doesn’t seem to exist anymore

1 Like