Most operating systems work in the same basic fashion—you install apps from the binaries or an app store, change configuration files as needed, and perform piecewise updates as needed. NixOS changes that approach entirely.
What in the world is NixOS?
An OS configured by listing components
Operating systems, Linux or otherwise, usually come with a set of pre-defined packages and configuration settings that determine what the OS looks like, how it acts, and what programs it can run.
NixOS relies on a different approach. Rather than modifying a pre-existing OS to suit your liking, you define exactly what you want using a description in a text file. That description includes all of the packages, services, account, and settings you want.
Once you’re done, you run nixos-rebuild switch, which reads flake.nix (or configuration.nix) and builds an operating system from that description.
In many ways, it reminds me a lot of getting a recipe on the internet and then creating a corresponding shopping list. You figure out what you need, then figure out how you need to put those things together. When you’re done, you have something to eat. Or, in this case, you have an operating system.
Underpinning the entire thing is a package manager called Nix, which manually drops each package into its own folder. Critically, the folder is named based on the hash not just the program, which makes installing different—and potentially conflicting—versions of software relatively easy. Your installer won’t try to mix them, and any dependency issues that might normally arise on a typical Linux installation are largely sidestepped.
Of course, this setup also introduces some problems. Most Linux software is designed to install using the typical Linux file system hierarchy, which means that something you install using something other than the Nix installer is going to have a problem unless you patch it.
It is like building an OS with a Docker compose file
Every time you build a “new” OS using Nix, the old version is left—inactive—alongside the new one. If something goes wrong, you just simply roll back to the last functioning version rather than messing with a recovery environment or manually troubleshooting the problem.
The text file-based configuration approach also makes it very easy to ensure that you can create, install, and run multiple identical copies of the operating system on different computers. As a home user, that won’t be super useful, but if you’re in a professional setting where you need to configure 100 PCs to be identical, it can be a great way to save time. It may also appeal to homelabbers. If you create a basic template, you can use it to roll out dozens of identical VMs or containers.
Who should use NixOS?
It is a niche OS
NixOS will be pretty jarring if it is your first foray into Linux, but developers, system admins, and homelabbers will all appreciate the ability to write one setup script and then reuse it dozens of times in the future.
That does come with some tradeoffs. Even minor tweaks should use Nix to pass along changes, whether that is a config tweak or installing a new app, so you’ll be rebuilding frequently. I’m used to invoking apt like a bad habit, and I found it was a pretty stark adjustment.
Additionally, Nix does take some time to learn, just like any other new system. However, you don’t get the same kind of transfer from apt or dnf to Nix that you get from apt to dnf—it is quite different. Additionally, Flakes, which is the direction the community is heading in, are still relatively new as Linux features go (many are now decades old).
And, as I quickly discovered, old NixOS builds tend to eat up space rather quickly. Over the course of a week, mine grew to about 20GB, and I’d expect that over a year it’d wind up over 100GB. Luckily, there is a succinct command to clean up the vestiges of your old system: nix-collect-garbage. I’d recommend running it relatively frequently, but only once you know your current version is stable.
You don’t need to dual boot to start with NixOS
I’d recommend just creating a bootable USB drive without installing it on the drive to see if you like NixOS. Once it is installed, mess with the configuration files however you’d like. You can also clone the whole configuration to a git repository, which makes rebuilding a new machine (or your current machine, if something goes horribly wrong) much faster.
For my own daily use, the build-rebuild system is a bit limiting. If I needed better stability, I think I’d be inclined to go with a more conventional immutable atomic distro like Kinoite instead.
However, for schools, government agencies, or even homelab applications, NixOS is an interesting approach to Linux that is worth checking out.
Credit: Nick Lewis / How-To Geek
Credit: Patrick Campanale / How-To Geek
Credit: Patrick Campanale / How-To Geek
Credit: Patrick Campanale / How-To Geek
Credit: Adam Davidson / How-To Geek
Credit: Ismar Hrnjicevic / How-To Geek




Credit: Patrick Campanale / How-To Geek
Credit: Patrick Campanale / How-To Geek
Credit: Patrick Campanale / How-To Geek
Credit: Adam Davidson / How-To Geek
Credit: Ismar Hrnjicevic / How-To Geek

















