After having used Arch Linux for quite some times, I finally decided to give NixOS a try. I already knew that distribution from being involved in DevOps things, having tried to replace the common $distribution + Python3 + Ansible Stack with something more lightweight, so I had a reason to mess around with NixOS. While it may look like an uncommon choice for work laptops, I’ll try to give my reason of using this in the following post. But first things first:
What Is NixOS?
NixOS is a purely functional Linux distribution built upon the package manager Nix. Nix uses a functional deployment model. The package manager allows easy rollbacks as well as upgrades of software. NixOS uses a declarative configuration written in a call-by-need functional programming language designed for the package manager. I’ll share my .nix files later in this post so you may have a good start into this.
NixOS doesn’t provide a graphical install but provides tools for formatting the
hard drive and a script to copy the base system to
/root. I used
luksFormat for the formatting, since I wanted a full-encrypted system.
The NixOS Wiki is an amazing resource which will guide you through the installation process.
configuration.nix currently consists out of 152 LOC, feel free to use this
as a base for your own installation if you’d like. It is ment to be used with a
ThinkPad t450 and pushed to GitHub.
Why Using NixOS Is A Good Thing To Me
I tend to reinstall my system every once in a while. Before writing my NixOS configuration, I had post-install sh-scripts for Arch Linux doing things like an initial network set-up, installing the programs I want to use and my preferred window manager i3, alongside with firefox, vim, compilers and some other tools.
Now it’s just cloning the .nix files to a new NixOS installation, deploy my
/home backup (I’m using borg for that) and start working. Plus I’m able
to deploy my base configuration to multiple systems, since I’ll probably create
one large-ish base configuration file and a few system specific in the next
And because you can’t install a piece of software without having a matching
meet-up for this in this time, I’ll probably join the
irregular NixOS Meetup
@afra later today.