Nixos or Linux as a service

Quick catch up

For those in the back that don’t know ; Nixos is the new thing to go to if you are a linux enthusiast. A fully reproducible distribution that generate an entire system from a single configuration file. And with the biggest package repository available on Linux you are sure to feel right at home. I am not lying to you, simply go check it out for yourself. I dare you to find a tool or an application that’s not on here. Everything that can run on Linux has been packaged by hordes of devops guy. Like beaver on a dam they can’t stand having a tool or a need that remains unpackaged.

You are being served

I really like the way Nixos is doing things, and I have taken to think of it as “LAAS” for “Linux As A Service”. Not Linux as a service like it is a paid software no. Linux as a service because you can easily start on this distribution and get a working configuration going on. Everything is abstracted to you and as long as you are following paths that other made possible everything will be going smoothly. In fact this could very well be the easiest distribution to setup for an elderly. You can enable automatic and atomic upgrades, garbage collector and other stuff. Your machine can run smoothly for a long time and try its best to serve your need. The technology is at your service and not working against you.

Comparaison with arch

I really like arch but while I understand the necessity of the maintenance that comes with it, I can’t afford the time to keep everything running smoothly. Nor can I take the time to learn or relearn again a subject that I already read a lot of times in the wiki. The wiki is great, it guides you from the start to the end and I would recommand to people that want to go in deep with Linux to start there. It covers everything and the only limit is your patience. That being said you can’t know and you shouldn’t try to know absolutely everything. Computer science is so vast that you just can’t win. There is no brain out there that can understand every small part of a modern operating system. I needed more abstraction from the base system.

My usecase

So for me, working as devops/ops/infra guy, the main benefit from Nixos is to use it a tool not as an OS. In one quick search on the nixos website I can discover packages made by other for tool that you could only dream to find on the AUR in good shape. I know that with a quick nix-shell I can test it right there and then delete it from existence and forget about it. I spend a lot of time trying new tools for different purpose. I have also a lot of tools installed at all times. I looked at many ways to handle them, arch repository, asdf, hombrew for linux, containers. But none of them are at the same time ; unified, complete, reproducible. The only distribution where I always feel confident finding a package is Nixos. More than that the graphical installer is very welcoming and is the only installer that never had any bugs. The default are very good and it suits me because I like strong default. By the way, if you create amazing features for your project, it should be used by people in the default config !

The other side of the coin

Once you are trying to use a package that is not in the nixpkgs repository though…You are in for a hard wake up call. You will have to quickly learn about a lot of things nix-related. You will have to learn how they work, what are the processes to submit a patch or a new package. You will maybe have to learn functionnal programming and depending on the string you will have pulled you might even regret using this distribution. As long as everything is wrapped in the official pkgs and options of the OS everything is smooth. BUT, if you venture outside this cleanly kept garden, you are on your own and you need a pretty good programming experience to make it work.

What is my workflow with Nixos ?

I let the hardware scan during the graphical installation make a lot of choices for me. I configure the automatic updates and the garbage collection of the nix store. And then I install the needed packages by looking them up on the website. Everything is on here it is pretty crazy and to this day I am not sure I ever needed something not in the repository. If a package is supposed to come with a more complicated setup with daemons or configuration files then no biggy, Nixos got be covered here too. Want to install docker ? It’s a one-liner in the config file, and once rebuilt and tested I can commit the changes I made to my repository to ensure I can use this version of my configuration everywhere I need it. This workflow is flawless and is very efficient for me. No problems just a plain declarative approach to system configuration.

Disadvantages

Unstable branch

Running unstable is really unpredictable because either your generation is created or not and you can’t only update some part of it. It might leave you stranded for weeks before letting you create an up-to-date generation.

Hardware requirements

While not absolute requirements the experience will be much better with a lot of fast storage and a good internet access. Some dependencies are present in multiple versions on your system to accomodate different package needs so it can pile up. Each new generation might also bring update to those packages and their dependencies.

Outlier packages

Something doesn’t exist in nixpkgs ? you have a good chance of being screwed. You need to work it out either way but my be in big trouble if you are at work and need a solution ASAP. Containers and VM might come to the rescue but this is not always elegant.

In the end

After a long day at work, I am not sure I want to manage servers or Linux machine at home. I want to spend time with my family, cook, clean a bit, laugh and watch a movie. I used to think it wasn’t even possible to keep Linux on my machine and be worry free but Nixos made it possible. It sure has some problems but it allows me to have a system running a free OS that is reliable and up to date. I can still tinker with it and go back to a safe generation of the system. I can try out new cybersecurity or devops tools in a matter of seconds without commiting to them. It sure fits my need at home and I am trying to use it more and more at work for the same reasons. My only worry is that at work if there is a custom tool that is not packaged it might become really painful.

Anyway I made my choice, Nixos on my system for now !