I don’t recall hearing of NixOS Linux until a tweet crossed my Twitter feed about a new release during the week between Christmas and New Year’s. I looked it up and was fascinating by the new ideas and approaches there. Here’s my awkward summar.
- Packages are immutable, like values in a functional language. Making configuration changes involves generating a new package.
- Each package instance, each version, is stored on the system in it’s own directory. Files aren’t installed all over the place in /usr/local/lib, /usr/lib, /usr/local/bin, etc.
- Due to the above, aliases are much more important than search paths.
- Also, the dependency tree for a package is very straightforward.
- System configuration is via a functional language and is a single expression in one file.
- So you can easily boot and run any configuration, back out changes, etc.
I installed it on a Virtual box VM and played with it briefly. One of the first negative things I noticed was a ps listing. Since each package instance is under a single nixos directory with a directory named by a long random hash, and since every running process is in a bin directory (or some such) in one of those, the path to any running program is a bear.
I pulled down nginx. That was easy. But then I went to configure it and that’s where I came face to face with NixOS’ trade off. You don’t change files in a package. As I understand it so far, you add code into the single configuration file that essentially edits, in this case, the nginx config file in a sort of sed-like way, and produces a new package instance that is used. So a nice and simple config file from nginx was turned into a functional language expression that now requires me to go learn that language.
I stopped at that point but I’m still fascinated by the distribution and the ideas there. There are some nice hard lines and properties of cleanliness here. Once the investment is made in learning the Nix config language, it may be straightforward to move on and maintain systems. For a simple server instance this may be something to try.
So, I’ll move on with it soon and see how it goes.