Switching from Arch to NixOS
The author discusses their transition from Arch Linux to NixOS, highlighting improved system configuration management, challenges with documentation, and a smooth setup process, while noting a steep initial learning curve.
Read original articleThe author shares their experience of migrating from Arch Linux to NixOS after a month of use. They were motivated to switch due to the need for a more efficient way to manage and automate system configurations, which they found cumbersome with the traditional "dotfiles" approach on Arch. The author highlights the challenges of maintaining a dotfiles repository, such as missing configuration files and issues arising from package updates. Nix, a package manager, and NixOS, a Linux distribution utilizing Nix, offer a solution by providing reliable and reproducible package management, isolating packages to prevent conflicts, and allowing users to configure their systems through Nix's programming language.
Initially, the author tested NixOS in a virtual machine to familiarize themselves with its unique user experience. They found the transition to be smooth, replicating their Arch setup in about four to five days. After a month of use, they noted that while the knowledge from traditional Linux distributions seemed less relevant, it was still applicable. The author appreciated the self-contained nature of Nix packages and the modular organization of configurations, which simplified their setup compared to Arch. However, they also pointed out the challenges of navigating NixOS's documentation and the abundance of options available for configuration. Overall, the author believes that Nix and NixOS are powerful tools for system management, though they feel the initial learning curve may not yet justify the time invested. They remain optimistic about the potential benefits as they continue to explore NixOS's features.
Related
Parallel Nix Evaluation
The blog post discusses Nix's speed impact on user experience due to Nixpkgs and NixOS growth. Determinate Systems' parallel evaluator boosts performance 3-4 times, addressing immutability challenges for faster evaluations. Ongoing work targets concurrency bugs.
At the Mountains of Madness
The blog discusses challenges in building executables for NixOS and Linux, focusing on ELF interpretation, glibc versions, and dynamic linking. It explores container use, NixOS dependency management, and proposes patchelf for cross-compatibility.
Lix 2.90 "Vanilla Ice Cream"
The Lix team released Lix 2.90 "Vanilla Ice Cream," a Nix implementation enhancing user experience with features like improved error reporting, faster evaluation, and style guide enforcement. Future plans focus on reliability and user-friendliness.
Nix Alternatives and Spinoffs
Various projects have emerged post Eelco Dolstra's exit from NixOS Foundation, offering alternatives to Nix. Auxolotl focuses on compatibility and community, Lix on backward compatibility and Rust, Tvix on Rust rewrite, Tangram and Brioche on hybrid builds, and Guix on stability.
Fusion OS: Writing an OS in Nim
The author details creating Fusion OS in Nim, emphasizing features like deterministic memory management and capability-based security. The project explores novel concepts and diverges from Unix conventions, focusing on experimentation.
As the sibling comment describes, Nix can get a bit gnarly once you're off the beaten path, and having your whole OS subject to that is a pain.
But as an alternative approach I run Fedora, and install key stuff through the OS using dnf in the normal way, but then I have a home-manager config that covers all my key config, and a lot of the extra applications.
Yes, I don't get the full "value" of a whole system under version control. But I have a very stable, well proven system with few surprises. And I also have good version control of my config and day to day apps.
Plus the extra Nix stuff - if I want to try out a program, or use it temporarily I can just launch a shell with it and it's not cluttering up my system for ever (e.g. when exa was on HN yesterday, I could just do `nix-shell -p exa` to get a shell with exa in it. At some point in the future it'll get garbage collected again).
This largely reflects my experience with NixOS as well. I installed it for a few months on my laptop (on two separate occasions) and there are parts of the OS I love. Being able to simply define your packages and user setup in a single configuration file is incredible, and even now if I wanted to switch back to Nix, I could dig up my configuration.nix and pick up where I left off. Gone too are the piles of mysterious packages installed on my system but I can't recall why they're there or if I still need them.
Unfortunately, once you start stepping off the beaten path, Nix often became a source of frustration. If there's a well working package available in its repositories, great. If not I found creating my own Nix packages to be an experience of arcane incantations, even for the simplest things. Compare this to writing Arch AUR PKGBUILDs, which are simple, glorified shell scripts, and it quickly led to me growing frustrated with the OS.
I think what eventually did me in was trying to get Neovim LSPs installed correctly. For some reason I never really understood, where ever my Nvim plugin was installing them was certainly not where Nix wanted them, and I never resolved the issue. Things like this eventually drove me back to the comforts of Arch, although every once in a while I look back over and wonder what could've been. I think it's the only distro I've tried in recent years that really tempted me to switch permanently.
The ideas of NixOS are fascinating, and I really think it can create a new paradigm in the Linux space. However, I'm unsure whether it'll be Nix itself that really gets there.
This is accomplished via the shell command:
'$ nix-shell -p <name of software>'"
i.e.,
$ nix-shell -p vim
Where <name of software> can be found from over 100,000 packages (here):
Functionally, the above is the equivalent of what Google Play Store, Apple App Store or Microsoft Store or what other Linux package managers are to their respective platforms...
To install software permanently, edit /etc/nixos/configuration.nix to include the name from above (typically under environment.systemPackages), and follow up with:
$ sudo nixos-rebuild switch
Also, it's not too difficult to undo those changes should that be wished, but that's beyond the scope of a simple HN post...
Anyway, in my opinion, NixOS is probably the most Software Developer friendly evolution of Unix since Linux itself.
Well worth a try for technical people -- but there is a learning curve when trying to do very specific esoteric things with it(!)... but that's sort of the case with anything technological...
That being said, there's lot more documentation about NixOS on the web these days than there was in the early days... so it may be worth a look!
But I don't know what the current state of it is as of now
Yes this is the start of a very steep learning curve but I have been taking it very slow and it has been working for me since day 1. I think it’s pretty brilliant that the entry level is so low.
Experimentation is cheap (just use grub to boot into your previous env if you mess up, try packages with nix-shell), and I have had great help in the Jupiter Broadcasting Nixnerds Matrix channel. Some great people are in there.
I've switched to using devenv[1] as a first step. This at least allows me to experiment with using nix to configure my dev environment in a per directory fashion, while allowing me to use the Linux distro of my choice.
Sounds like having NPM as an OS. Absolutely no thanks.
I'll stick with "difficult" package managers that seem to resolve things simply rather than having 27 different copies of the same thing and having to worry about things I didn't before. If, for whatever reason, I need two disparate versions of something I'll figure it out myself rather than abstracting it away.
In my mind, this move seems to be moving from 'high potential energy' to 'low potential energy' where you don't have any room to escape; you have locked yourself at the bottom of a pit and you just have to hope things don't roll over the top because you are at the whims of what NixOS has decided. If you were in a 'high potential energy' situation (ie: Basically any other distro), you would have room to fix it yourself or even take your widely compatible dotfiles and move to a different OS. Even if you are allowed to do configuration outside of NixOS as written, I am going to guess that NixOS isn't a huge fan of it and that configuration is fragile.
> However, after using NixOS for a while, I realized this was not true. The abstraction that NixOS packages provide doesn’t hide everything from the user to avoid confusion with irrelevant details. Instead, it offers a way to configure your environment the Nix way, so the resulting configuration files are created by Nix.
I'd rather beat my head against a wall for a day figuring out how to configure something than get locked into an OS-specific configuration that I can't move elsewhere.
Also when you combine it with this:
> The documentation is not in great shape.
Absolutely no thanks. You are telling me I have to do things the "NixOS way" but also your documentation is bad / inferior? Absolutely no thanks.
Related
Parallel Nix Evaluation
The blog post discusses Nix's speed impact on user experience due to Nixpkgs and NixOS growth. Determinate Systems' parallel evaluator boosts performance 3-4 times, addressing immutability challenges for faster evaluations. Ongoing work targets concurrency bugs.
At the Mountains of Madness
The blog discusses challenges in building executables for NixOS and Linux, focusing on ELF interpretation, glibc versions, and dynamic linking. It explores container use, NixOS dependency management, and proposes patchelf for cross-compatibility.
Lix 2.90 "Vanilla Ice Cream"
The Lix team released Lix 2.90 "Vanilla Ice Cream," a Nix implementation enhancing user experience with features like improved error reporting, faster evaluation, and style guide enforcement. Future plans focus on reliability and user-friendliness.
Nix Alternatives and Spinoffs
Various projects have emerged post Eelco Dolstra's exit from NixOS Foundation, offering alternatives to Nix. Auxolotl focuses on compatibility and community, Lix on backward compatibility and Rust, Tvix on Rust rewrite, Tangram and Brioche on hybrid builds, and Guix on stability.
Fusion OS: Writing an OS in Nim
The author details creating Fusion OS in Nim, emphasizing features like deterministic memory management and capability-based security. The project explores novel concepts and diverges from Unix conventions, focusing on experimentation.