Interact with this post using Mastodon or
A new journey begins: NixOS (part one)
Published on
I’ve been an Arch user for the past 15 years, and in the early days, it provided a challenging but rewarding experience for learning Linux. There was no easy installation process, manual configuration of xorg, and various other fun tasks that helped me gain extensive knowledge. Nowadays, Arch is perfectly tailored to suit my requirements, fulfilling all my needs without exception. It may be worth mentioning that my needs are relatively basic, including office work, digital drawing, and simple coding. Despite the misconceptions of non-Arch users, Arch is stable, and I don’t have to update it every hour.
I want to clarify that I have no intention of persuading anyone to choose one distribution over another. The purpose of having a plethora of distros is to allow users to find the one that suits them best, and there is no definitive “best” option. However, I have been hearing a lot of great things about NixOs and its unique approach, which has piqued my interest. As someone who enjoys exploring Linux (imagine Indiana Jones with a penguin as his best friend), I decided to give NixOs a try and see if it could potentially become my new home.
It’s important to note that I have never been sufficiently intrigued by any other distro to invest time in testing it, and this speaks volumes about the allure of NixOS. Last week, I installed NixOS on a virtual machine, and the experience has already provided me with plenty to discuss. Therefore, I thought it would be beneficial to write this initial post to share my brief encounter and learn from your insights to further progress. I will continue testing NixOS and document my journey here, with the duration of this expedition depending on the knowledge I gain from more experienced users.
Although it is tedious to repeatedly express, I want to emphasize that my intention is not to provoke a fierce debate or fuel a distro war. I am merely sharing my personal experience, which is currently limited and subjective. It is important to note that my experience should not be regarded as a universal statement or be used to evaluate or judge NixOS. I acknowledge the possibility of inaccuracies or gaps in my understanding, and ultimately, as of the time of writing this post, I find NixOS to be the most appealing distribution for my needs.
╭── NixOS is growing
Due to irs early development state, NixOS has some issues and I will not ding it for that. I still see a great potential for this distro. With that out of the way, let’s focus on the main concepts that define NixOS (from the official website ):
Reproducibility
“Nix builds packages in isolation from each other. This ensures that they are reproducible and don’t have undeclared dependencies, so if a package works on one machine, it will also work on another”.
If I certainly see how important this would be for a server or an admin who needs to easily deploy a system on several machines, I don’t really feel doing the same thing with Arch for example would be an issue for a single user like me who needs to clone his system on two machines max. Let me try to be clear here: the whole idea is awesome, it may just have a limited interest for users with simple needs or at least I missed it and from my personal experience deploying my system on an existing or brand new machine does not take more than 5 command lines and 30 minutes of actual efforts (not counting the time for the system to install itelf).
Declarative
“Nix makes it trivial to share development and build environments for your projects, regardless of what programming languages and tools you’re using.”
NixOS takes a unique approach to system configuration by using a purely functional, declarative model. Instead of manually modifying configuration files, users define the desired state of their system in a configuration file using the Nix expression language. At least that’s what I’ve read everywhere. If in the facts you start with two config files (a general configuration file and one for your hardware), these files are only here to boot your system. As soon as you start building your system you accumulate the usual config files for each of your app and you call them within your configuration file (or another NixOS “baic” configuration file if you’re using home manager and/or flake).
At the end, I remained unable to perceive any benefit of this approach compared to constructing a similar NixOS configuration files structure and utilizing stow
in Arch. The sole exception is the NixOS hardware configuration file, which merely spared me the effort of adding one line to each of the three system configuration files that I will not modify again. The only minor advantage I can envision is the potential to consolidate all personal system configuration parameters for my system applications (excluding hardware settings) into a single file, yet thus far, I have been unable to find a method to achieve this aside from implementing a bash command in the configuration file to copy my parameters as needed (which is rather unsightly). Therefore, I am certain that there is something I am overlooking. I would greatly appreciate any feedback here.
Reliable
“It allows you to roll back to previous versions, and ensures that no package is in an inconsistent state during an upgrade.”
NixOS is an immutable system so once an installation is provisioned, its state remains immutable. This means that any changes or updates to the system are made by creating a new configuration and applying it, rather than modifying the existing system. This approach ensures reliability and simplifies rollback in case of problems. I again definitely see as a big plus for large infrastructure management. For me with two machines max and a stable I do not feel the need for rollback. I can only remember three times where I broke my system (it didn’t break itself) to the point where I couldn’t boot it. If it’s not convenient to boot on a live system, it was still good enough for me to recover within a snap that didn’t impact my productivity. Also, I have an “integrated” recovery system on which I can boot while not having to bring an external drive with me.
Also, “Nix ensures that installing or upgrading one package cannot break other packages.”
This is crucial and part of the NixOS philosophy that makes it so interesting to me. I see a lot of similarities between NixOS and Arch and maybe the early stage of NixOS and its failures (that will be quickly addressed with no doubt) probably evoke a sense of nostalgia within me and explains my interet for this distro.
Nix package manager
It provides a purely functional and atomic approach to package management allowing users to install, upgrade, and remove packages without any conflicts or dependency issues. This is again similar to Arch except that this package manager takes full advantage of all your cores and runs tasks in parallel making the whole process more efficient. Also, even though I personally don’t have the need for it, it offers the ability to have multiple versions of the same package installed simultaneously. This is awesome to ensure easy experimentation and testing.
You don’t like NixOS, stupid!
I realize that my NixOS is currently extremely limited and this brief summary does not cover all the NixOS good stuff but that’s why there is a full documentation. Speaking of it, a recurrent criticism is NixOS documentation which is not complete nor easy to read/access. So far, I feel that it’s good enough, especially considering the few years of existence of this distro and its still heavy development. In that regards I have no doubt as how NixOS will improve as well.
It certainly doesn’t help that NixOS is so different in its approach and new concepts like home manager and flake but this is part of the deal you accept when using it. Adjusting to something new is demanding but it can pay off. As Linux users it’s no surprise for you.
Ok, I hear you and I will not ignore you: “why are you even interested in NixOS if you keep not finding anything better than in your Arch system? And BTW you’re stupid because if you’d be smart you would have realized than NixOS is way better anyway.” You may be right, you may be wrong, or there is a middle point.
Yes so far I didn’t see any sufficient advantages for me to move over to NixOS and I feel like I could achieve the same thing with my system in a more simple manner because I don’t have to reconfigure everything the Nix way and use its language. But I’m not closed to learn new things and NixOS will definitely help me with that. Even though it’s not a good way to learn about Linux in general because everything is NixOS specific, it’s still extremely entertaining and challenging. Also, if I end up not moving to NixOS in the next weeks/months that doesn’t mean Arch is better. It will just mean that Arch is better for me. As I said, I can already see why NixOS would be a great/better choice for specific cases.
What I already need to work on
I have compiled a list of things that I am aware of and need to improve upon. These are all user-related issues, not limitations of NixOS, but I am sharing them here in the hope of seeking your advices.
- The unique home manager and flake concepts are still very vague to me. I’ve set them up both but didn’t really use flake yet for real. Re: home manager, I’m still struggling to understand how it’s different than
stow
to svae/restore your dotfiles. I’m certainly using it incorrectly. If you can create a nix file as your dotfiles, you can also source any file in your home.nix file but doing so creates a read only symlink in my system. - If using nix files instead of dotfiles, is there a way to apply the changes without rebuilding NixOS entirely? Even though relatively fast, I can see that quickly becoming a boring process for me and my taste for experimentation.
- As mentioned earlier, I don’t know how to properly add configuration options in my filesystem files.
- I had difficulties transferring my
neovim
full setup. Currently I still havepip
not being recognized byneovim
and some plugins like mason are not working. - I did not encounter such situation but is there a way to identify which package/file is broken instead of rolling back your system and randomly trying to update it until it works?
- My touchpad is working but not recognized when using libinput-gestures. I left this issue aside because it may be due to the fact that I’m running NixOS in a virtual machine.
Conclusion (not the final one)
I still find some interest in testing NixOS. I also still keep some hope it could become my new home at some point. Every time I feel like I’m spending too much time for no benefits to what my current system offers me, it just takes 5 seconds to convince me that my limited experience was not sufficient to give me a good enough picture of what NixOS is and how it could improve my productivity and simplify my system maintenance.
My initial misconception led to setting up incorrect expectations as I believed I could establish a complete system using just two config files. I came over that and now I’m really looking into learning about NixOS and getting the best of it. I’ve just started reading through the NixOS encyclopedia and will never be able to go over all of it. I’ve spent around 10 hours watching videos on how to start with NixOS and its core concepts. All of that is just the beginning of a long journey and whatever the outcome is I will not be disappointed but I would like to do things right as much as possible and for that I need the support of the community.
I will keep reporting my progress here and hope that my feedback so far will not be misinterpreted.
Thanks for your read. Hope it's been useful to you.
✄ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈
More food for thoughts? Check other posts about: #System