I’ve been using NixOS for quite some time, but somehow I ended up with Guix. In this article I will try to write about the reasons why I don’t use Nix anymore.
The Emacs > Elisp > SICP > Scheme pipeline
I honestly don’t remember the first time I heard about Emacs, but I remember the first time I tried to use it I got gatekept by the Elisp magecraft. After that, I spent some days trying to learn some basic concepts of this ancient text editor. Thanks to https://learnxinyminutes.com/docs/elisp/ I was able to write some simple functions to make my Emacs experience smoother. To be honest, I didn’t really liked to write Lisp back then, it sucked a lot for me. Even reading simple functions was a hassle since I wasn’t used to see through all the parenthesis. At that time, I already knew about the ‘Structure and Interpretaion of Computer Programs’ book, but didn’t read until then. It was only after seeing the MIT class linked below that I got hooked into computer magecraft:
Lecture 1A: Overview and Introduction to Lisp: https://www.youtube.com/watch?v=-J_xL4IGhJA
That was when I finally decided to read the SICP and, consequently, learn Scheme.
The Nix language and documentation sucks
And that alone is huge win for Guix. Configuring Nix packages was a pain in the ass. Not because you need to set everything up from scratch (that’s not even a problem), but because the language is confusing as hell and the documentation doesn’t help. It’s not a secret, everywhere you go on the internet you will find people complaining about how the Nix language is hard to grasp, but no because it is complex, just because it lacks proper documentation. You can’t be sure to find what you’re looking for. All the information is fragmented on the internet, there is not a place where you can just find what you’re looking for. At the end of the day you spend more time guessing “where the information is” rather “how to do X”. For instance, here’s a comparison between the figlet package ported to Nix and the one ported to Guix:
And no, I’m not even talking about how the Nix code is bigger than the Scheme code, that’s not really a problem. The thing is, which one is easier to read? Which one is easier to maintain? Which one is more elegant? Which one is more expressive about what it does? The Nix language was a mistake and I think it is the Achilles’ heel of the Nix project. I can assure you that most of the people using NixOS right now don’t even know how the language works, most of the time tthey just copy and paste code that was already written by some Nix wizard and call it a day. But the moment you need to do something new you’re left in the lurch. But I have to admit, most of the Nix wizards are nice people and they will probably help you. The thing is, do you really want to depend so much on the community to get things done?
Guix solves that. It’s not like you need to learn a complex language to start with Guix, Scheme is relatively simple and most of the time the docs are everything you need to get up and running. Packaging a program for Guix isn’t hard, I plan to make another blog post to delve into that soon.
The LISP way of life
There are some reasons why some Emacs wizards stick to LISP: metaprogramming, macros, higher-order functions, recursion etc. Not only that, LISP is a crucial part of computer science history. It helps you understand why things are the way they are. It helps you understand mathematical concepts. It helps you understand functional programming. It helps you understand core concepts of programming, hence Scheme is used as the language for the SICP book.
And yes, Nix also supports abstractions, but Guix’s use of Scheme provides more powerful and general ways to define those abstractions. Since all the Guix configuration and packaging logic is expressed in Guile Scheme, you can deeply customise and program your system at at level. For instance, you can define custom operating system services, package definitions, or system configuration options entirely in Guile Scheme. You can’t really say the same for NixOS. The language itself is more limited to package definitions, which makes it harder to set system-level configurations. If you want to customise deeply at system-level you will probably need external scripting or some other configuration management tools.
Scheme has a long history in theoretical computer science and has been used for decades in academic research and programming language design. Using Scheme to configure your system basically gives your superpowers, it’s pretty much like standing on the shoulders of giants. To be honest I don’t see a point in learning such a complex language as Nix just to define packages. Scheme gives you so much potential for broader use cases other than package definitions. System configuration, scripting, automation, general programming, you name it. Even if you don’t plan to write packages for Guix you still can use Scheme for lots of other tasks, specially if your using the Guix operating system.
Guix is Free (as in Freedom)
Guix places more emphasis on software freedom and adheres to the FSF standards for ethical distros.
Yes, I do use some proprietary software, but that’s something I want to change. I would say that the only reason I still use the Linux kernel is because of the lack of free bluetooth drivers for my laptop. That’s something I also want to change. I made a mistake buying a bluetooth headphone, specially because I already knew that there were no free bluetooth drivers for me. I hope to abandon Linux and its proprietary binaries as soon as possible. Software freedom might be hard to achieve, but freedom in general isn’t easy to achieve.