HOW DO WE DEFINE “THE OS”, ANYWAY?
I used to get pretty stroppy about things like “Pop! OS” or “Elementary”, both of which are just re-skinned Ubuntu, but from a this blog perspective, I’ll just say that the “OS” is the stack from kernel to UI that serves as the functional basis for providing services and applications for getting things done. In that sense, I think it’s entirely fair to consider Ubuntu as distinct from Debian as distinct from Gentoo or Arch or whatever – the UI aspect of all of them are pretty different one from the other, and at the end of the day, I am a user of my machine, so the UI is pretty much the endgame, here.
MAC vs LINUX
So the biggest difference between my Macs and this Linux box is that Mac OS (I refuse to use Apple’s dumbass orthography) is produced by one organization, with one singular (if flagging) direction and design. Everything is intended to be run on a closed system – not from a software licensing perspective, but rather from analogy to closed-world assumptions in logic – everything the Mac does has been designed from the start, and there are fixed boundaries around its functionality.
Obviously, this is only vaguely true, if at all, but to my way of thinking it gets at an important philosophical point about the Mac – it’s intended to be used in ways that were foreseeable if not forseen by Apple. Linux is entirely different. The reasons for this are interesting, and I’d imagine that there’s a pretty good sociology disseratation in examining the interactions between the legal theory of it (the GPL) and the process by which it has been created. But for my purposes, Linux (or GNU/Linux, which … whatever) has an open possibiity space – the kernel was just sort of released, and multiple entire ecosystems have grown up around it.
The most important distinction, then, is that “Linux” refers to a family of operating systems, which share, at a minimum, a kernel. They range from pure enterprise Unix replacements to weird-ass single-proprieter strangenesses to embedded soft real-time systems complimentary to their hardware. There is nothing at all comparable to Mac OS in this world – except arguably the one I chose to use.
TALK TO ME ABOUT THIS NIXOS BUSINESS
NixOS is a Linux distribution designed around the idea of a completely idempotent, declarative system; the goal is to write a program that, when executed, yields a completely defined Linux computer. Obviously, this is bounded – without some shifting context, an idempotent system would be tautologically uninteresting; but the distribution’s efforts in expanding the boundary of what is and isn’t amenable to declarative configuration has revealed that we can get a great deal further down this road than previously thought.
I’m not up on the prior art, but the idea here is one that’s been floating around for a while; it’s not dissimilar to the “cattle not pets” mantra in what has become “DevOps” – the idea that you should treat your servers not as specially hand configured systems themselves, but rather as the output of a process, where the actual instances themselves are entirely disposable.
NixOS takes this idea, and runs with it. The actual bits on disk are just the expression of the program you write (in the Nix language, the less said about which the better), so you can check that Nix program into source control, share it with your team, experiment with it as if it were a program that you were writing on top of an operating system target. This is deeply appealing to me, as a person with three and change decades of professional experience dealing with Unix systems. There used to always be some random crappy text file you needed to edit to make sure that your SCSI chain came up in the right order or something, and you never remembered them all, and shit was always breaking. Always. So from a systems administration perspective, this is a revelation.
BUT I’M NOT A SYSADMIN (THANK GOODNESS)
If this NixOS thing is a reaction to the broken-ness of systems administration, and a great fit for DevOps and deployment and stuff like that, why on Earth run it as your daily driver?
Well. Partly because I’m difficult, and think that things should be hard or they’re not worth doing; but also, because the goal of a completely declarative system means that spooky action-at-a-distance problems are significantly less likely to occur. NixOS allows for rollbacks, and if a configuration isn’t actually compilable, it won’t compile. Why is this important? Let me tell you a story!
Back in the Paleolithic – say, 1997 or so – I was running some kind of RedHat derivative/precursor on a computer at work, and I went down into the bowels of it’s (terrible terrible terrible) dependency resolution/package management software, and removed everything that used X11 – after all, now that this computer was no longer getting setup on my desktop, it was going to go get shoved in a closet somewhere and didn’t need an interactive display. 1 This is the time of 240MB ATA disk drives, so you know, every byte was sacred or something.
So I went ahead and removed all the packages that mentioned X – it was
dozens, even back then. And then everything broke. Like, literally
everything. I had to hard power cycle the box – I couldn’t even issue a
shutdown. When it wouldn’t boot, I grabbed an install floppy (1997,
remember?), mounted the root filesystem, and started reading the logs.
Guess what? Some happy genius had decided that it would be a good idea
init – you know, process 0? The single most important process
on a Unix machine? – against some X library or other so that, if
was invoked as
reboot or something, would pop up an X dialog asking
“ARE YOU SURE?”
This really happened! Removing X murderized the entire system! And there were how many warnings? How easily was this bit of administrative malpractice allowed to happen? It really put me off of my feed, when it came to Linux. And sure, I screwed up, but honestly, oughtn’t the system have at least warned me that I was murdering it?
This anecdote is intended not to shitshame whichever distribution I was using, but rather to point out that the weirdest upstream decisions can really sabotage the experience of using a computer. And the more transparent those decisions are, the easier they are to either accomodate or work around.
I’m a little out of gas, here, so I”m going to push send on this and then write up the OS level stuff that I’ve found surprising or interesting in the switch from Mac to NixOS.
yes, kids, we used to unbox machines, set them up with a keyboard, mouse and display, and then move them to a “server closet” which was, at least in those days, often just … a closet. ↩︎