A review of Nix/NixOS after using it on all my machines for three years. I'll cover what works, what doesn't, and why it's the first OS that's stuck with me.
I’ve been stuck on Nix for two weeks because I thought it would be a good idea to put a distro I had never used but that wouldn’t break on my backup laptop in case my main one ever broke. I just couldn’t force myself to install debian, not that I have anything against debian, it’s just… kinda boring, while Nix seemed very interesting. IT SEEMED LIKE A GOOD IDEA AT THE TIME I SWEAR.
Guess what happened… I broke Arch. Then I reinstalled and the next day the laptop broke. Then the next day I tried to get my data back and the hard drive broke. So, backup laptop with Nix for two weeks…
I really really really like the declarative stuff. Installing packages through config files is so nice I’ll never lose track of what I’ve installed ever again 🥰 🥰 🥰 I was already using a git repo for all my config files + GNU Stow to symlink everything to its proper place, so adding the .nix configs to that setup was very easy.
Having a clean system on rebuild is great. No more clutter left everywhere that I don’t know about, no more half broken stuff left lying around.
But…
It’s not Arch. Not Nix’s fault, but I kept hearing that it would be “like Arch but declarative”… and it’s really not 😑 Everything seems over-complicated vs as simple as possible.
I absolutely hate the language.
What’s with those error messages from hell???
And speaking of hell, every language that can’t just use indentations like YAML instead of cluttering the code with {} and [] and () should have been relegated to the darkest pit of hell 20 years ago. But points to Nix for being awful than JSON (the comma on every line but not the last thingy make me want to build a time machine to go murder the grandparents of whoever thought it was a good idea)
Packages are out of date even in the unstable branch (I know it’s unfair since it’s not trying to be a rolling release…)
Where are the source packages? Is that an Arch only thing? I liked having packages that automatically use the latest git commit without needing to manually install from source and manually update like a medieval peasant… 😭
Nix packages are weird. Even someone who’s terrible at coding like me can read Arch PKGBUILDS… I miss you Arch 😢
Apps not working because of paths that don’t exist on Nix… what do you mean I need to patching the package myself? 😭 At least there’s steam-run, great preserver of what’s left of my sanity.
Can’t wrap my head around installing some stuff like VSCode extensions (the advice I got was "don’t bother just do it imperatively 😑 )
Wiki is often sparse on info and not very helpful if you don’t already know what you are doing (and I clearly don’t 😅)
But it’s kinda growing on me. Like mold. Or cancer.
It’s reproducible, so random updates are a no-no. You can however just dump the Git URL in your flake.nix inputs and then override the src of the package with that. The source gets updated when you do nix flake update next time. Something like this:
Nix has more up to date packages than most distros have packages in total. There’s a bot that goes around updating them automatically if they are from github. Maybe there’s an issue with your package?
Packages are out of date even in the unstable branch (I know it’s unfair since it’s not trying to be a rolling release… but… but…)
Sure, some packages are outdated. But in terms of percentage of up-to-date packages, it’s (AFAIK) the best out of any distro repo. And that’s perhaps even more impressive of a feat when realizing it also sports the biggest repo. For actual stats: https://repology.org/repositories/statistics/pnewest
Wait how does Nix Unstable have a better score than the AUR? With four times less maintainers? That’s really impressive, especially considering how much more simple Arch packages are to make.
But points to Nix for being less awful than JSON (the comma on every line but not the last thingy make me want to build a time machine to go murder the grandparents of whoever thought it was a good idea)
While some people love putting Lisp in everything, I really don’t get it. Guix is far uglier than Nix in the language department. Scheme is not a configuration language and thus has none of the nice things that Nix has (multi-line string handling, defaults, lazy evaluation, inline expression, etc.), instead you get multiple levels of macro spaghetti. Furthermore, Guix forces you to turn everything into Scheme, where you can just use plain Bash in your Nix build steps, in Guix that is all Scheme.
I had spent a lot of years with Scheme before starting with Guix and then spend quite a few years with that, but even after all that switching to Nix just felt so much better instantly. Instead of trying to hack a DSL onto of Scheme you just get a language that’s actually build for the task.
That is something you can’t quite escape in Nix either. While it doesn’t use parenthesis like a Lisp, the nature of the language and the depths of the sets you are dealing with still makes you end up getting a lot of this at the end of your files:
];
};
};
};
}
Having one } too many or too few is a pretty common issue with Nix and feels very similar to Lisp, even when the rest of the language is quite different.
I’m not a fan of nested parenthesis… but aside from that I don’t know much about the language, is it more convenient? Does it also suffer from the error messages from hell problem?
I’m just seeing your comment after I recommended Guix, that I could read and understand Guile Scheme is what made me hop away from NixOS, the nixlang is an ungrokable mess
Yes it’s a headache if you don’t have a clue what you’re doing and suck at coding like me, but the good parts might make the headache worth it depending on what you want of your distro. A week ago I couldn’t wait to get a new laptop to reinstall Arch, but now I’m actually wondering if I should keep trying Nix… OH GOD HAVE I CAUGHT THE NIX BRAIN CANCER? 😭
I’ve been stuck on Nix for two weeks because I thought it would be a good idea to put a distro I had never used but that wouldn’t break on my backup laptop in case my main one ever broke. I just couldn’t force myself to install debian, not that I have anything against debian, it’s just… kinda boring, while Nix seemed very interesting. IT SEEMED LIKE A GOOD IDEA AT THE TIME I SWEAR.
Guess what happened… I broke Arch. Then I reinstalled and the next day the laptop broke. Then the next day I tried to get my data back and the hard drive broke. So, backup laptop with Nix for two weeks…
But…
But it’s kinda growing on me. Like mold. Or cancer.
It’s reproducible, so random updates are a no-no. You can however just dump the Git URL in your
flake.nix
inputs and then override thesrc
of the package with that. The source gets updated when you donix flake update
next time. Something like this:inputs { ... mypackage_src.url = "github:myorg/mypackage"; mypackage_src.flake = false; ... }
pkgs.mypackage.overrideAttrs (oldAttrs: { src = mypackage_src; version = "nightly-${mypackage_src.shortRev or "src"}"; })
Nix has more up to date packages than most distros have packages in total. There’s a bot that goes around updating them automatically if they are from github. Maybe there’s an issue with your package?
Sure, some packages are outdated. But in terms of percentage of up-to-date packages, it’s (AFAIK) the best out of any distro repo. And that’s perhaps even more impressive of a feat when realizing it also sports the biggest repo. For actual stats: https://repology.org/repositories/statistics/pnewest
Wait how does Nix Unstable have a better score than the AUR? With four times less maintainers? That’s really impressive, especially considering how much more simple Arch packages are to make.
https://en.wikipedia.org/wiki/Douglas_Crockford
Yeah, fuck that guy!
Check out Guix_System_Distribution, it’s just like NixOS but uses a Scheme dialect which is a better language.
While some people love putting Lisp in everything, I really don’t get it. Guix is far uglier than Nix in the language department. Scheme is not a configuration language and thus has none of the nice things that Nix has (multi-line string handling, defaults, lazy evaluation, inline expression, etc.), instead you get multiple levels of macro spaghetti. Furthermore, Guix forces you to turn everything into Scheme, where you can just use plain Bash in your Nix build steps, in Guix that is all Scheme.
I had spent a lot of years with Scheme before starting with Guix and then spend quite a few years with that, but even after all that switching to Nix just felt so much better instantly. Instead of trying to hack a DSL onto of Scheme you just get a language that’s actually build for the task.
If you like parentheses anyway
That is something you can’t quite escape in Nix either. While it doesn’t use parenthesis like a Lisp, the nature of the language and the depths of the sets you are dealing with still makes you end up getting a lot of this at the end of your files:
]; }; }; }; }
Having one
}
too many or too few is a pretty common issue with Nix and feels very similar to Lisp, even when the rest of the language is quite different.I wonder what your thoughts on guix would be, especially considering your thoughts on the language
Succinctly : “OH GOD MY EEEEEYES”
I’m not a fan of nested parenthesis… but aside from that I don’t know much about the language, is it more convenient? Does it also suffer from the error messages from hell problem?
I’m just seeing your comment after I recommended Guix, that I could read and understand Guile Scheme is what made me hop away from NixOS, the nixlang is an ungrokable mess
I’m sure it’ll get better once I’m more used to it, just venting a bit. Sorry for the rant
I found this very entertaining lol. And it also confirms I made the right choice not using Nix as my daily driver. This sounds like a headache.
Yes it’s a headache if you don’t have a clue what you’re doing and suck at coding like me, but the good parts might make the headache worth it depending on what you want of your distro. A week ago I couldn’t wait to get a new laptop to reinstall Arch, but now I’m actually wondering if I should keep trying Nix… OH GOD HAVE I CAUGHT THE NIX BRAIN CANCER? 😭
You use a lot of emojis.
Yes emoji use is proportional to the decrease in my sanity after those two weeks
Relatable.