On my new install of nixos, I boot a tty with the message that the xorg failed to load, and to prompt systemctl status display-manager for details, which can be found here, along with my current configuration:
Fortunately, logging into the tty shell and simply running systemctl start display-manager boots me to lightdm. I read this xorg page in the nix wiki, but that doesn’t suggest to do anything I’m not already doing.
I’ve tested the following, which suggests to me that this is a trivial change somewhere in the configuration file having to do with starting the display-manager service.
After a nixos-rebuild switch && reboot, the display manager service fails to start.
Entering systemctl start display-manager starts lightdm.
Rebooting fails to start the display manager.
Entering systemctl enable display-manager, and rebooting successfully starts the display manager on startup.
The offending section, if there is one, seems likely to be in this section, though I note that nixos-option services.xserver.enable and nixos-option services.xserver.displayManager.lightdm.enable both return true, both before and after a system rebuild/reboot.
clue-ish: on startup, after 2.5 seconds I get several errors:
nvidia-gpu 0000: i2c timeout error e0000000
ucsi_ccg i2c_transfer failed -110
[ OK ] Stopped X11 Server.
Starting X11 Server...
[ OK ] Started X11 Server
[ OK ] Stopped X11 Server.
Starting X11 Server...
[ OK ] Started X11 Server
...some backlight drivrs load...
[ OK ] Stopped X11 Server.
[FAILED] Failed to start X11 Server
See 'systemctl status display-manager.service1 for details.
It’s weird that:
the nvidia error happened, suggesting I should go look at nvidia-related wiki pages
I’m not sure what the ucsi_ccg driver is, so I gave it a quick look, and found this post, which I’m going to give a shot, blacklisting the nvidia driver. This arch forum post suggests that the latter error is probably harmless though.
Those errors are harmless, it’s a red herring I’ve been running X fine with them showing up for months now, it’s a known bug in the kernel with a fix here that somehow hasn’t made it into mainline yet: https://bugzilla.kernel.org/show_bug.cgi?id=206653#c19 (seems down at the minute, but whenever it comes back up…).
I struggle to recall context, but I think it was about attempting to load a certain driver for GPUs that don’t actually support it.
Given that Xorg fails, you probably want to look at the Xorg logs: journalctl -t xsession . Depending on your configuration other useful logs might live under /var/log/X and ~/.xsession-errors.
Thanks for saving me a goose chase then. It looks like .xsession-errors is empty, but I put up the results of journalctl and /var/log/X.0.log on my gists. Still looking through them, would be razzed if you’d care to take a look with me.
You seem to only share the last couple of lines of your log there, probably copied from out of the terminal? If you pipe the journalctl output to a file, it’ll skip the pager and dump the entire logs to a file:
journalctl -t xsession > file.txt
There may also be other log files in /var/log/X that’ll contain info from previous invocations. If you copy out just the 0 one it’ll be from the current session, i.e. probably the working one, which isn’t that useful here
Any reason you have network config there? I hope that PSK is censored.
it just started lightdm as far as I could tell
(/nix/store/hphsx5383075c6l7s4kvnkp9hmjww4gz-unit-script-display-manager-start/bin/display-manager-start):
and changing the display-manager to sddm in my case solved the issue.
P.S. calling sudo lightdm –-test-mode --debug showed an error. However I forgot to save the output. But if you are interested, I can revert to lightdm and try to replicate the messaeg.