Tuesday, June 10, 2025

NixOS and X11 in 2025

I spent two days last week reinstalling Nixos "bottom up", with X11 and i3. During day two I was thinking "this is such a waste of time". However it was not, here is why:
  • Learning is about doing, and often in software that means "type it in yourself". Therefore, to install NixOS this time on a laptop, I typed everything in: the disk partitions, LUKS keys, grub setup, and new configuration file with X11 specs.
  • I am a better developers when the system I develop on feels "simple and clear" because I configured it.
I bring up this experience to share a few things. The first is that being a developer is both about being stubborn in a smart way, and about accepting loss gracefully. For example:
  • What to do when you are locked out because somehow when you changed your LUKS keys you "screwed up"? You just reinstall again, and zenfully accept the loss of time for not being careful.
  • What to do when you insistently fail to try to avoid to depend on the nixos network manager, because you want a "most simple declarative approach"?  You give up and use the network manager.
  • What do you when you cannot find how to configure your X11 setup so as to be able to manually launch startx? You persevere! To finally find that one needs services.xserver.displayManager.startx.enable = true; in your configuration!
The second topic is why X11 and NixOS in 2025:
  • X11: Initially because my son installed Wayland on my larger computer, and I felt I needed to freshen up a bit by going back to my roots of developing under X11, which I had done from 1985 to 1996. Then later last week, the Xlibre project forked from the Xorg xserver because the Xorg foundation was trying to kill it. This event added some value in hedging against being dragged into the unknow that is Wayland's future.
  • NixOS: Because I love the ability to install a new machine from scratch to be exactly the way I want it in less than thirty minutes. However I do need mention that I will migrate away from NixOS because its founder Eelco Dolstra was removed in 2024. When asked about the subject, my favorite LLM said: "Something went wrong, please try again (13)". Which really means: better hedge the unknown risk of NixOS. 
A final remark, NixOS configuration is "horribly informal". A configuration entry like  services.xserver.displayManager.startx.enable = true is really quite close to being a hack, because it is a local choice that depends on invisible rules that are translated it into something that makes sense. A single mistake at any point along the chain of dependency of the OS installer will screw things up, and there is no easy way except for regression tests to protect yourself from these mistakes. A more formal way to configure linux would be to expose its architecture within the configuration semantics, so that configuration attributes fit within broader properties which have their own rules of consistency. If someone knows of such a more formal declarative Linux configuration approach, please tell me!

All original content copyright James Litsios, 2025.

No comments: