Xserver became broken after installing KDE

Hello. I am using i3wm, but one day i decided to try KDE plasma. So I replaced windowManager.i3.package = pkgs.i3-gaps with services.xserver.desktopManager.plasma5.enable = true in my configuration.nix and run nixos-rebuild switch. After rolling back to i3 (actually, I didn’t roll back via nix, i just typed git checkout in /etc/nixos) and rebooting, this xorg config

     config = ''
       Section "Monitor"
         Identifier "LVDS1"
         Option "ignore" "true"
       EndSection
       Section "Monitor"
         Identifier "VGA1"
       EndSection
     '';

stopped working, so 2 monitors were powered on. Also, what is the most annoying and important for me, computer started to suspend every 10 minutes after inactivity.

I’ve tried to delete all garbage (sudo nix-collect-garbage -d) and made rollback of root (but without /nix/store) using zfs snapshot before i installed Plasma, but it didn’t help.

What am i doing wrong? How it’s even possible to get two different systems on the same configuration? And how can i fix automatic suspend and xserver config?

I use 19.03 if it’s important. Also, if I stop display-manager(or xserver?), computer does not suspend.

Probably some config files plasma or the display manager left over in your home directory that’s causing problems.

I’d try to remove ~/.dmrc (it contains the last used session, which lightdm is a bit too happy to use). ~/.xsession is another possible culprit.

Similar issue with pantheon: Pantheon not working · Issue #57327 · NixOS/nixpkgs · GitHub

After rolling back to i3 (actually, I didn’t roll back via nix, i just typed git checkout in /etc/nixos) and rebooting,

This alone won’t roll back your system, you’ll need to also run ‘nixos -rebuild boot’ to build the new system. Or, you can select an older boot entry at the bootloader.

I made zfs rollback of my home partition to the state before i’ve installed plasma, so problem might not be in home configs.
Right now i’ve deleted ~/.dmrc and /root/.dmrc (i don’t have .xsession), but it didn’t help.

I discovered, that if i dont close lid switch, laptop won’t suspend. So I changed logind settings and it fixed problem.

  services.logind = {
    lidSwitch = "ignore";
    lidSwitchDocked = "ignore";
    lidSwitchExternalPower = "ignore";
  };

But I still don’t now why my services.xserver.conf stopped working.