`nixos-rebuild switch` Crashes WM/DE

Hi,

I mentioned this issue under this topic. With that topic being resolved I thought this issue would go away but apparently it hasn’t.

So, when I tried nixos-rebuild switch it upgrades the system as usual but during the process it just crashes/quits the window manager (I’m using Sway) and all I can see is just a black screen with a white cursor. I tried this on KDE Plasma too but got the same result. This first happened a little more than a month ago. Does anyone have any idea why would this happen? Thank you in advance!

1 Like

I have also noticed this (only on Plasma as that’s what I use) but I haven’t yet taken the time to dig into why. Clearly something critical ends up getting restarted instead of just reloaded.

1 Like

same here with i3 (filler to reach 20 characters)

from what we could figure our so far it looks like systemd-logind is restarted if the rebuild includes a systemd update, which takes all currently active sessions down with it. (haven’t yet had the time to dig into verifying whether that’s the entire reason, nor attempting to fix anything)

4 Likes

This also affects me. Is there already a Nixpkgs issue?

EDIT: I found rebuild issues, grub · Issue #145249 · NixOS/nixpkgs · GitHub, but I am not sure if it is related.

I think this is a different issue. I also think it’s systemd-logind because it affects sway started from a systemd/user unit.

I’m not sure if we even can restart user units properly from nixos-rebuild. I think the biggest problem is that wayland isn’t quite solved and unified and the custom setup approaches don’t interact well with rebuilding.

Ideally there’d be a systemd unit for everything wayland (i. e. display-manager.service) that can be restarted by nixos-rebuild properly. While crashing is bad, the best case scenario was always going to be restart wayland…

The issue (maybe a different kind of crash though?) also appears when just starting sway manually.

1 Like

I created a nixpkgs issue: `nixos-rebuild switch` crashes/quits DE/WM · Issue #146727 · NixOS/nixpkgs · GitHub

1 Like