DEV Community

Discussion on: Au Revoir, Gentoo - Sell Me A New Linux Distro

Collapse
 
kovirobi profile image
Kovacsics Robert • Edited

Excellent, I get to recommend my favourite, NixOS (I am not affiliated with

them, apart from submitting packages and occasional bug[fixes]).

First, some vocab:

  • Nix Expression Language -- the core lazy functional language in which the packages and the OS configuration is written.
  • Nix -- the package manager, can be used on non-NixOS, e.g. MacOS or any other Linux distro.
  • Nixpkgs -- the set of 'upstream' packages. This is actually quite a lot, see repology, so hopefully you won't have to do any packaging.
  • NixOS -- an OS built from a configuration written in the nix expression language

So you can try out Nix without going all the way to install NixOS first, but only some of the points may apply.

Pros:

  • It's very different, not just different command names, great if you want to learn a different way of doing packages.
  • Offers very easy rollbacks to a previous configuration.
  • Offers declarative config, in a single consistent way (i.e. not just a git repo of the files under /etc). Also offers imperative installation of applications (e.g. you don't need to rebuild the whole declarative config to install a program, though putting programs in the declarative config makes the system easier to reproduce, e.g. for reinstall or different computer).
  • Non-root package installs (AFAIK you cannot install e.g. setuid packages, so you cannot use this to write a package that just opens a root shell and non-root install it). Multiple installs of the same package share the disk-space, so no duplication.
  • Allows a language-agnostic variant of something like Python's virtualenv for projects. E.g. This also applies for Nix, not just NixOS so you can use it with colleagues who don't use NixOS.
  • Can override packages, so perhaps some of the benefits from Gentoo? E.g I prefer the X toolkit emacs to the GTK one

Cons:

  • It's very different, not just different command names, packaging software might be more annoying, especially for proprietary software (there are bypasses, e.g. it has a (easy I think but I haven't used it) to set up an FHS chroot (systemd-nspawn, no root user needed AFAIK).
  • Need to learn the Nix Expression Language, a fairly simple functional programming language but still might be a bit of a learning curve.
  • Non-root package installs make quotas difficult (there might be a solution to this, I didn't really look into this, just a potential heads-up).
  • Fairly memory hungry (when installing packages or when rebuilding the system). I do use it fine on a 4GiB RAM netbook though. Possibly partly due to the sheer number of packages.

I have managed to reinstall my system after I discovered my old hard-drive was having problems, in 45 minutes. This might seem like a lot, but it included getting back to the exact configuration, which would otherwise be a week of tweaking things. Also, the actual install only took 5 minutes, the rest of time was:

  • Partitioning (figuring out how to use parted) 10 minutes
  • Waiting for the screen to turn on, cumulative 10 minutes (for some reason my screen takes about 2 minutes before it shows a picture, so this was just spent waiting for the right boot prompt, and some pressing of DEL key).
  • Fixing a bug in my config 10 minutes -- I wrote a custom script to show random backgrounds because the feh default is prone to the birthday problem, but this had a bug when there were no images to set as background.
  • Installing bootloader and getting UEFI to boot that drive by default, 10 minutes. This ties in with both the partitioning time and the waiting for screen to turn on time.

If you love Scheme/Guile and/or lack of any proprietary packages (Nixpkgs has proprietary packages, but hidden/disabled by default -- easy to enable though) try Guix. Ideas based off Nix, but different set of packages (AFAIK, I haven't played with Guix much).

If I have you interested, perhaps try installing it? For learning the nix expression language, the manual and nix-pills are useful, but to give it a spin, you don't need to read everything right away, for basic things the examples in the manual and some intuition should do you fine.

Collapse
 
deciduously profile image
Ben Lovy

Hah, was wondering if this would come up. I actually have a Nix install on this hardware too, it's my second-in-command and I LOVE it. I'm going to have to do some serious thought about why I'm not ready to go exclusive with it - mostly it's just so, so different.

Collapse
 
kovirobi profile image
Kovacsics Robert

That's fair enough, especially if you want/need to use arbitrary proprietary packages, e.g. I sometimes need Quartus for work then sticking for something well known or FHS abiding works much better.

Collapse
 
kalbasit profile image
Wael Nasreddine • Edited

+1 NixOS. I've moved to it from Arch for the same reason as you, Ben. Broken Vim installation caused by a :PlugUpdate on a very busy day is what broke the camel's back for me; curious what it was for you.

I've written about my motivations for the move here: kalbas.it/2019/03/24/why-i-use-nixos/

Happy New Year!

Thread Thread
 
deciduously profile image
Ben Lovy

To be honest, I don't remember - I don't know if it was any one specific thing, or a sudden realization that I was wasting a lot of time. The specific "straw" is probably irrelevant - it was a long time ago, in any case.

Great write-up, thanks for sharing. I'm hoping that NixOS will someday be the answer I'm looking for here, it's incredibly cool.