Okay, so hear me out…
My interest was piqued when I started knowing more and more about NixOS from the recent “I use NixOS btw” wave everywhere. The main selling point for me was the one config file to rule them all. I have always wanted something like that on Arch. And here it is with a dose of immutability, and extra stability in the form atomic updates and whatnot. You also had the option of turning it to a rolling release model; that’s awesome! What’s not to love then?
So, I kept reading even further about NixOS. I got to learn about how the Linux root structure is almost completely different. Building packages from the source follows a completely different procedure. Configuring anything in your system will rely on the main config file, instead of executing the standard terminal command, or editing their respective config file. The list goes on…
I understand that all of this is done by design. They are not flaws, per se. Rather the means to facilitate the philosophy that every NixOS user is after. However, that also does not mean it is inherently flawless in the grand scheme of the entire ecosystem. I personally love Linux, and would always want to grow with my knowledge in how I handle and get things done in it. Wouldn’t me disconnecting away from that, in favour of the NixOS’ arcane methods, just hurt my progression in my Linux learning journey?
This is a genuine question, of course. I have been thinking about this for a few days now, unsure of whether I should change course and get into it or not. I also do not have the time to use other distros aside from what I mainly install; I would be all in. So, what do you all think?
deleted by creator
More advanced in what way? (Excuse my ignorance)
It’s declarative, reproducible, has atomic rollbacks. Most of the compelling reasons to use Docker are just worse versions of what’s available with Nix. Its Dockerfiles are an attempt to make a declarative, layer-based description of the resulting operating system, but in a less rich way than Nix (which is a higher level of abstraction and has a stronger type system.)
Look at how easy it is to create containers with Nix: https://nixos.wiki/wiki/NixOS_Containers
It’s basically a matter of changing
services.nginx.enable = true;
tocontainers.my-container-name.services.nginx.enable = true;
.
As someone very experienced with NixOs, people are starting to catch up with it, but it’s much more advanced than the docker kubernetes mess most developers end up working with.
I seriously think that Docker has done more harm than good to the general ecosystem, while when sparingly used, can mitigate some issues with specific dependencies, it has somewhat evolved into “just ship every application with a full stack”. Sure you can do that, but there’s a reason it was done differently before… but the understanding of system administration isn’t always there for developers.
I agree that Nix solves the issue quiet elegantly, at least in those places where it can be done without too much effort. Steam is a regular offender regarding normal practices though. But at this point I’m rather thankful that Steam exists and Linux is actually a first class platform than complain about purity, especially for a tool that mostly launches games.
I don’t think NixOS is used by many companies, so it’s not really a skill that will likely lead to employment. Most companies use containers and tools like ansible which is accomplishing something similar to nix.
Community is growing fast in recent years and more and more companies are using it. I know a big real estate company is using it but you won’t hear about nixos when buying a property from them.
It’s same like unit tests or static typing. It’s extra work and some don’t think the benefits are worth it. On top of that the learning curve for nix is steep.
This is also a great point in case I have any prospect for a future job in Linux.
NixOS is just a hobby, it’s good if you don’t have a GPU since you can’t play any games either way.
Linux is a kernel. At the beginning, software, especially userland software mimicked Unix conventions. There is very little requiring that anything work the way it does, except for inertia and convention. As cloud native conventions gain steam, a lot of them are working their way backwards into things like Nix. Having spent some time working with things like K8s and Packet and cloud-init quite a bit, I welcome declarative instantiating and configuration at the OS level, at least for those use cases. Stuff like Ansible, Chef, Puppet, Salt etc have been the middleware between the legacy OS layer stuff and a declarative CM system, but they all have an absolute pile of complex scripts and tests to make sure that when you say “I want this package installed”, it knows how to do it correctly and safely on the target system. Using a leaner declarative model at the package level makes it a lot simpler to declare the desired state.
I am pretty bearish that it will ever see overwhelming adoption for desktop users, but I see it having a ton of relevance when you want to orchestrate a whole butt load of server instances
I don’t believe NixOS prevents you from using the standard terminal commands or editing config files. It hooks you up with a different set of tools, ones which are better in some respects, but it doesn’t force you to use them.
nix-env -iA is there for a reason, they recognize that sometimes perfection is the enemy of good #-#
I don’t know if you’ve used Emacs, but NixOS ALMOST feels to Linux how Doom Emacs is to GNU/Emacs. Not including all the benefits like reproducability, it feels like a reliable framework placed on top of Linux in the same was Doom Emacs is a framework on top of Emacs.
Doom to vanilla Emacs is closer to what Arco is to Arch. Gets you off the ground qucikly, has some opinionated configs, and lets you try out a bunch of stuff before moving to your own config. You still install and configure packages in almost the same way, but there’s a macro layer in front of those functions. It’s still the same editor with the same goals.
Nix/guix have different goals than other distros, and so they do things a lot differently. That difference is usually the complete opposite of what Doom is trying to do as it makes the average person’s life harder and the expert’s easier in specific scenarios. For example:
You want to use a programming language with up to date libraries?
Normal distro: use the language’s package manager, install shit, get to work
Nix/Guix:
a) download the package from the repo, if it’s a year out of date, it’s time for you to learn how to write packages. Write a package for every library you need, and then maintain them
b) run your shell in a containerised environment that’s simulating fhs, pray that it actually works, and then slap your ide on top
A) is amazing for software companies because of reproducibility and precision, and because companies have enough devs that writing and maintaining packages is a minor investment unless you’re using Js. On the other hand, a random dude trying to code is going to have a much easier time using a one liner to install the newest version of the package directly from the language’s pm.
Linux is Linux, nix is just a tool to essentially build a view of the root filesystem in a special way. In the end, it’s not that different than if you do everything from Ansible playbooks, in a Dockerfile, from Puppet/Chef or any other automation technologies.
Heck, if you look closely at Debian/Ubuntu, there’s the whole debconf system that lets you configure packages directly from the package manager, and it generates configuration files based of that. If you install Postfix on Debian, it’s going to ask you how you want to use it and it generates some ready to use configuration files. Then if you install Dovecot, it might just work out of the box using that configuration to know how you set up Postfix and let you fetch your emails over IMAP. It’s not nearly as comprehensive as nix does it, but the concept of a main configuration file is far from new, nix just pushed it to a whole other level.
Building packages also differ wildly between distros. ArchLinux uses simple PKGBUILD files that are essentially just bash scripts. Debian uses debhelper and dh_make, and lets you do some really crazy things with the build system to reduce boilerplate so that all Python packages for example are built exactly the same way and often in just a few lines.
Distros also put files in different places. On Debian, system-wide systemd units are in
/lib/systemd
, but it’s/usr/lib/systemd
on Arch. Distros use different tools:apt
,yum
,dnf
,pacman
,pkg
, etc. Debian in particular really likes to ship with heavily customized configurations. For example, if you install NGINX on Debian or Ubuntu, you have a/etc/nginx/sites-{available,enabled}
and it’s got a helper script to easily enable/disable a site. On Arch, there’s no folders, you get a plain basic default/etc/nginx/nginx.conf
. On macOS, I have that config in/usr/local/etc/nginx/nginx.conf
. The default location of configuration files is inherently a compile-time property, just so happens that most distros puts it in the same place.I’ve worked with part-time admins / web developers that completely panic when they SSH into a system that’s not Ubuntu and they don’t know how to do anything.
If you like NixOS, just enjoy and you’ll be fine. Completely different means of achieving the same things, and if anything will make you more aware of potential variations. Nothing preventing you from having VMs with more classical distros to keep up to date with how to admin those. A lot of things still work the same: you can still
systemctl restart
a service, you’ve still got a bash shell that works exactly the same. You’re just going to manipulate and template nix files instead of directly modifying configuration files, but still ends up generating that file for the software to use.I use Arch for all my stuff, and Ubuntu at work. Because I use one doesn’t make me not well versed in the others. NixOS have real advantages, and I know some companies that have fleets of NixOS servers.
Having been in a similar situation to you, I say go for it. Arch taught me the basics about Linux that I think everyone should know to understand what Nix does under the hood, but as soon as I saw how well NixOS worked on my secondary machine I switched my primary over and I’m not regretting it in the slightest.
That’s not to say Arch is a bad distro, in fact I’d say 99% of my Linux knowledge comes from that excellent community, it really is KISS, but it makes no secret out of what this actually means: making it simple for the maintainer by delivering an almost untouched upstream, which I agree brings the ecosystem forward as it pushes toward a bazaar model where everything works together without the distributor doing too much work of their own. But if you want to keep a system clean in the long run, at one point you realize that you need a system like Ansible (which for me retrospectively has shortcomings that can only be fixed in the underlying system) or Nix integrated in your base system, which NixOS does.
These are the kinds of comments that made me start researching NixOS in the first place. Damn it :D
Well, if it helps you, if there’s no urgent need to switch, you don’t need to, you’re missing out on some good stuff but nothing that can’t be done during the next setup or so. I had to reinstall anyways at one point, initially thinking it’d be Arch again, and then after testing NixOS decided to go that route, the Secure Boot functionality with Lanzaboote was a strong plus. On the other hand, adding your own packages to Arch is somewhat easier I feel, they’re both good distributions, you’re not making a mistake with running either of them.
From what I’ve heard from NixOS users, your intuition seems right. When you learn NixOS, you learn NixOS rather than Linux. The question is, what your goals. If you want to get a job as a Linux sysadmin, you’d probably be better off using a more common distro. But if you just want to use Linux privately, dive into whatever seems most exciting to you or fulfills your needs the best.
When you learn NixOS, you learn NixOS rather than Linux.
That is exactly what I am talking about. You seem to have understood me the most. NixOS could be the unequivocally best distro ever. However, that does not change the fact that a big portion of your knowledge acquisition and experience gained from your time on NixOS, will be for NixOS alone.
I am obviously not putting the two on the same line, but mac shares a lot of terminal syntax and programs with Linux. They still remain vastly different. So, this is exactly what concerns me with the growth that I seek in the Linux ecosystem.
My question then would be: Why do you want to learn more about Linux in the first place?
I don’t mean to sound crass here, but the best answer I can give you is, “because I want to”. I wouldn’t go as far as to say that I will pursue Linux professionally as a job. But who knows? I wouldn’t out-rule that.
It’s something that I am passionate about and enjoy using. Therefore, I will naturally want to grow my knowledge in.
Not crass at all. I would suggest that you follow your gut instinct. If NixOS excites you, go for it. If you want to understand the intricacies of Linux itself, look into Linux From Scratch. If you want to understand how “regular” distros work (and what sets them apart from each other) hop around between your usual suspects until you’ve scratched that itch long enough. Want to form your own opinion around init systems? Use a distro that supports Runit, s6 or OpenRC besides systems.
I don’t think anyone else can tell you what you should do in this situation.
Have fun!
Many thanks! You are absolutely correct. I just wish I had the time for such fun adventures.
That being said, it does seem I will definitely go through with trying out NixOS on bare metal, on my second SSD, and see how it goes. If I see any merit using it over to it from Arch, then I shall do so.
I’ve heard NixOS is used on big scale deployments, and it is a well paid job it just won’t be easy
No disagreement there. There are companies that use NixOS. But I’d argue that the majority of paid Linux admins don’t manage NixOS systems but rather RHEL, Ubuntu, Debian, OpenSuse and others.
Yes, of course. NixOS is just a “nice to have” kind of thing.
I’ve been using replit to host some small projects, it’s a real pain as replit is so heavily relied on nix packages.
I was interested in NixOS until I saw no reference of a specific software I want. Literally not a single search result.
So, I guess its biggest flaw for me is that it cannot beat Arch Linux’s catalogue. So, maybe in a year I’ll check again.
I am curious to know what kind of programs do not exist on Nix. Could you please share the one on your mind?
IMO if you get more into it it’s still really linuxy. You still use the same software under the hood, especially when writing custom modules. A ton of knowledge transfers, with more new cool stuff to learn.
A ton of stuff you can just configure manually. Not everything has to be done in nix, but most people prefer to do it - I do it for example to have the same system between my laptop and PC. Really useful.
Oh, I agree with you. I have brushed off dozens upon dozens of distros, because they just do not offer anything over Arch linux that I have always been using. Until NixOS entered my radar, that is. NixOS has many very unique strengths that you just can not get anywhere else. Due to that, it was the first to make me question whether I should make a switch to it or not.
However, I disagree that a “ton of knowledge” transfers. Putting aside the programs one uses, the way you set up, configure and maintain your system will wildly vary from a standard distribution. Which will not help you at all in case you want put all what you have learnt into another machine that requires said ‘normal’ distribution. But again, I understand that this is the whole point of its design in the first place.
I think once you actually try NixOS you will find just as I did that it is basically just a thin abstraction over systemd (assembled with the Nix package manager). All the good Linux things you had to learn that can be called actual knowledge will transfer over directly, while some of the bad things, like terrible package managers, will be supplanted.