My opinion about NixOS - Written: 03 October 2022
Over the past few months, I have been using NixOS as my main system. How has it gone?
Hello! Recently I have wiped my computer of Ubuntu and moved to NixOS. I have been using it for the past few months and would like to write a review detailing what I have done with it and some of the challenges that I have encountered along the way.
First Impressions
When installing nixos, I chose to use the Minimal ISO image as I wanted as much customization as possible when installing. After installing, the first thing I did was to add a desktop environment. I was surprised that it was as simple as adding a couple of lines to the config!
services.xserver = {
enable = true;
displayManager.gdm = {
enable = true;
};
desktopManager.gnome = {
enable = true;
};
};
This idea of specifying an outcome and nixos sorting out the steps to achieve it is very handy for quickly modifying the system and is very effective at removing clutter. For example, with a traditional package manager, it is extremely easy to install unnecessary packages or to forget to uninstall a package that you wanted to test (I know you have done that before) and that always ends up interfering with a future package you want to install. Ever tried to install multiple versions of node? Good look doing that with APT. Nix and NixOS sort this out for you, as anything that you haven’t said you want gets removed automatically when you update the config.
Nix Shell
One of my favorite features of Nix and NixOS is the ability to create a new shell with a package of your choice, test it out temporarily, and then once you exit the shell, it will disappear from your environment, no harm done.
Home Manager
After playing around with the various options in the nixos system configuration, I discovered a tool known as home-manager. This is an incredible tool that allows you to manage configuration for various applications, such as git
and vscode
along with installing user-specific applications. The best part about home-manager
is that you can reload your configuration without having to reload the whole system through sudo nixos-rebuild switch
. This is very useful for when you are testing out a new configuration and don’t want to have to wait for the whole system to rebuild.
Managing Dotfiles with Git
As you may have noticed in the asciicast above, I store my dotfiles in a git repository. This is a very useful way of keeping track of your configuration and allows you to easily roll back to a previous version if you mess something up. To do this, I have created a dotfiles
folder in my home directory, copied the various configuration files into it and symlinked them to their original locations.
Downsides
Over my time using NixOS, I have encountered a few strange quirks and issues. The most obvious of which is the various outdated packages on the package repository. I used to use the 22.05 channel, but I have been forced to switch to the unstable channel due to the constant reminders from packages that try to auto-update and fail from the read-only nature of the nix store. Another issue is that the package repository is not as large as other package managers, such as APT. This means that some packages are not available, or are not available in the latest version. This is not a huge issue, as you can always install the package from source, but it is a bit of a pain. The final issue that I have encountered is that in home-manager
sometimes documentation and configuration settings available are not reliable or up to date. I found this issue when trying to configure gnome-terminal
, as the configuration allowed settings such as transparencyPercent
to be set, but this setting was not available in the latest version of gnome-terminal
.
Conclusion
Overall, I have been very happy with my experience using NixOS. It is a very powerful tool that allows you to completely customize your system to your liking. It does have a few minor quirks and I would recommend it for advanced users who are already comfortable with the Linux command-line, however I will be continuing to use NixOS as my main system for the foreseeable future.