Hi everyone!
I saw that NixOS is getting popularity recently. I really have no idea why and how this OS works. Can you guys help me understanding all of this ?
Thanks !
The increasing popularity of NixOS can be attributed to several factors that make it stand out among other Linux distributions. Some of the key reasons why people are switching to NixOS include:
-
Reproducibility: NixOS allows for reproducible builds and deployments, ensuring that the same code will produce the same output across different environments[1][2].
-
Easy rollbacks: NixOS has built-in rollbacks, which means that if a configuration change causes the system to be unbootable, it is easy to roll back to a previous working install[1][3].
-
Nix package manager: NixOS uses the Nix package manager, which simplifies package management and system configuration[1].
-
Multiple versions of the same package: NixOS allows users to have multiple versions of the same package installed, which can be useful for testing and development purposes[1].
-
Stability: NixOS is considered a very stable platform compared to other Linux distributions, such as Arch Linux[3].
-
Declarative configuration: NixOS uses a declarative configuration approach, which offers benefits over the imperative approach used by more traditional operating systems[4].
In addition to these features, the recent introduction of the open-source platform flox has made it easier for developers and enterprises to adopt NixOS. Flox expands on Nix’s unique approach to package management and system configuration, providing convenience, collaboration, and control throughout the Systems Development Life Cycle (SDLC) [5]. This has led to an increase in the adoption of NixOS among developers and enterprises.
Overall, NixOS offers a combination of stability, reproducibility, and flexibility that appeals to developers and users who want a reliable and customizable Linux distribution.
Citations:
[1] https://itsfoss.com/why-use-nixos/
[2] https://techcrunch.com/2023/02/07/flox-raises-27m-to-bring-nix-to-more-developers/
[3] https://ramsdenj.com/2017/06/19/switching-to-nixos-from-arch-linux.html
[4] https://www.anthes.is/nixos-pros-cons.html
[5] https://finance.yahoo.com/news/flox-raises-27-million-introduces-140100442.html
I would love to have #4 on Arch / EndeavourOS.I recently had my Scribus install (SVN from the AUR) break due to Arch moving to some newer library. There really isn’t an easy way to solve this AFAIK.
Do you use Nix, personally? Also, it’s crazy that I found this post while thinking about distro hopping.
The above poster seems to use more ChatGPT than Nix, personally.
this comment reads suspiciously like it was written by an LLM (eg ChatGPT). was it? please don’t do that!
Do LLMs give citations? Otherwise, I could agree.
Do LLMs give citations?
(The citations in this comment appear to be all real links about NixOS, but they are not particularly relevant to the places in the comment where they’re cited.)
-
NixOS is the only[1] Linux distribution that feels like it is build around Free Software. Meaning upstream Git repositories can be treated as first-class citizen and installed directly without convoluted binary packaging system (that still exists in the background, but only as cache to speed up build times). Nix also makes it very easy to upgrade, downgrade, side grade, patch, override dependencies or otherwise change packages, or even just keep multiple versions of the same software around. Something many other distributions still struggle with or make completely impossible with the distributions own tools. Even the act of installing software in Nix becomes somewhat unnecessary, as you can just run software straight from the Git repository.
And best of all, it’s all based on a very simple and transparent packaging system, if you ever used GNU stow, kind of like that, it’s all held together with a bunch of symlinks and some environment variables. No contains, no ostree, none of those ugly workarounds, just plain old Unix stuff that you can
find
andgrep
through as much as you like.Simply put, NixOS puts the joy back in Linux, while other distributions like Ubuntu try to actively trash their reputation with a proprietary App store and others like Debian just stagnate around and are still stuck with the same old packing system that was state of the art 25 years ago and hasn’t improve much at all since than. NixOS just provides a dramatically cleaner and simpler approach that also happens to be vastly more powerful.
Another cool thing, if you don’t wanna switch distributions just yet and reinstall the full NixOS, you can just use the Nix package manager itself on whatever distribution you are already using.
[1] There is also GNU Guix, which is basically a reimplementation of Nix with Guile/Scheme
It’s in no way “everyone”, just a vocal minority.
I use
ArchNixOS BTW.
Here’s the straightforward version of why I use it:
-
The entire state of your operating system is defined in a config file, and changes are made by changing the config file. This makes it super easy to reproduce your exact system many times and to know where all the many different configuration elements that describe your system are located.
-
Updates are applied atomically, so you don’t have to worry about interrupting the update process and if it fails, the previous state of your system is still bootable. By default every time you change something, you get another option in the boot menu to roll back to.
-
Making container-like sub systems is super easy when you’re familiar with nix, so you can have as many different enclaves as you like for different software versions, development environments, desktop setups, whatever without taking a performance hit. Old versions of stuff are very accessible without breaking your new stuff.
-
The package manager has a lot of software and accessing nonfree stuff is straightforward. Guix looks rad, but nix ended up being the more practical compromise for my usecase. I didn’t want to have to package a heap of software the moment I made the switch.
This very much. I used to have lots of unchecked config and state files everywhere on Arch. Now everything is checked in and wiped on boot so if something breaks after a reboot i know what broke.
Like how the opengl rendering did due to nixpkgs version differences
-
I’ve been using it for over a year and love it. A config file for your entire system, and built in rollbacks anytime something goes wrong. One language to configure everything, although in practice that doesn’t always work. But I love it.
Some others have started why it works, here is some how. Nixos completely disregards the fhs. Packages don’t install to anywhere standard, every package and configuration change gets it’s on directory in /nix/store but through smart use of tracking everything there, it symlinks all those files to proper places and sets up the environment for them to know where libraries are.
This is then also why you don’t need sudo privileges to install things. Your profile has an environment that is aware of your users packages and configurations, the system itself isn’t effected because everything is symlinked.
Then because every update means new directories in /nix/store you can role back to your last configuration because plasma broke something or whatever.
However, it’s a LOT to learn. Best place I know of is https://piped.video/watch?v=AGVXJ-TIv3Y&t=0
This guy did a good job for me. Hope this helps!
I switched around one and a half years ago. I must say, there are some hurdles to using NixOS. Mainly I dislike that it always takes around 20 times the effort to start and project. You make up for the initial time investment, because you end up with a far more stable setup, but still it does take some willpower to get things started.
I keep seeing trends with Linux distribution like teenager looking for new fashion.
I think it’s mostly the very young Linux user who hope from one distribution to the another over and over whereas many just stick with what they got : Ubuntu, Debian, mint, maybe fedora.
NixOS is certainly interesting tho.
everyone
Now that’s what I’d call a stretch…
Indeed, why would I switch, already have been running NixOS for 10+ years.
I’ll edit. That was clearly a stretch
I will switch as soon as I can get proprietary Nvidia drivers to work on my laptop.
That is the main reason I can’t use my laptop with linux. It has a 3060 in it. I work as a dev and need to use 2-3 external displays with my laptop. The driver combined with x or wayland is atrocious, I tried 20 distros and I can’t get it to work. The saddest thing is that none of the tech is exotic in any way. It’s just HDMIs and AOC 24 inch monitors…
Glancing over the website, I thought it’s an immutable OS, like Fedora Silverblue. I could imagine that it might be cool to use with Ansible and stuff. But for an average user? I can’t really see the advantages in respect to the work you have to put in.
It is an immutable distro, altough it isn’t image-based like Fedora’s rpm-ostree.
NixOS basically replaces Ansible because the Nix package manager achieves the same goals already (configuration, deployment, …).
But I agree, the work necessary to put into this non-standard distro makes it hard to recommend for a casual user.
It’s insanely stable but you have to have a lot of linux/programming knowledge to do even the simplest things like installing/updating your software or making little tweaks. I played with it for hours the other day and I’m just too dumb to figure it out lol I think it’s just a super stable highly customizable distro for power users and a lot of people like that. If you can get over the learning curve it’s a pretty powerful and unique os
It’s kind of funny because I’d put NixOS on a complete newbies computer for sure, and recommend it to an expert… But I’m less sure if I’d tell a random mid-intermediate Linux user to switch.
Like if Grandma wants Linux on their computer to do some internet browsing for some reason… I’d absolutely put NixOS on it because it’s easy to manage the system for them… But somebody who is a little familiar with Linux already might be more confused about the differences. It’s kind of the ultimate beginner distro and the ultimate power-user distro, but a bit awkward between those extremes, haha.
It’s true that it can be a powerful distro but I’ve also heard from some users that the advanced-level documentation is lacking and only limited to forums and source code. I think maybe if the documentation was more thorough I would try nixos.
you have to have a lot of linux/programming knowledge to do even the simplest things like installing/updating your software
So, pretty much like any other distro
Most mainstream distro’s can do all of that without a CLI.
Weird, every distro I’ve tried either has no management, or doesn’t work. Just spins around loading. “Uninstalling” packages does nothing but remove them from the package manager.
I used NixOS for a couple of years. My experience is like this:
- It is a rolling release (mostly)
- You write a declarative configuration for your system, e.g., my config will say I want Neovim with certain plugins, and I can also include my Neovim configuration
- It is stable, and when it breaks it is easy to go back
- Packages are mostly bleeding edge
Note that there’s both the rolling unstable channel and a bi-annual stable release channel.
Important to note that NixOS has both a rolling release and point release version.
The configuration stuff seems great. I guess it reduce the struggle of porting a full config from one pc to another right ?
You can even define configurations for different systems/hosts/users from a single place. I’ev atomized my config and I can reuse lots of parts for my different machines. Also my user config is nearly identical (except hardware specific things).
Yes absolutely. It is really great. It is also a source of frustration, e.g., missing configuration options, non-obvious options and so on. Overall it works well.
Are you still using it and happy with it? I’ve been increasingly using single purpose dev VMs in a server, and a declarative configuration system would make the process of spinning them up faster and more robust. My current shell script system is clunky, and I’ve been looking at Ansible.
Not using it anymore. Although I’m thinking about going back to it. The NixOS learning curve is a bit more steep than most other distros.
What are you using instead?
NixOS is a fully declarative and reproducable system.
What this means is that you can create a single
configuration.nix
, which includes all of your applications, settings, aliases, environment variables, user account + groups, etc., and copy that over to another NixOS machine (including different architectures) and runnixos-rebuild boot
to completely reproduce the system on that other machine.The nix package manager is also really good at telling you if the configuration will break anything, where, and how, and refuses to apply until the issue is fixed.
Also every time you use
nixos-rebuild
, it creates a new generation of your NixOS install meaning if something ends up breaking, you can reboot into the old system.So for example, I can theoretically have the exact same configuration across my desktop, laptop, phone, server, etc., minus the automatically generated
hardware-configuration.nix
, which is specific to the hardware.Also Nix supports package overlays, which means that you can modify an existing package while the maintainer still keeps it up to date.
Oh boy my two cents time!
I love the concept of NixOS. A fully declarative , reproduceable system from a single config repo! Sounds theoretically like it would be my kind of thing.
Sure, theoretically, I could have a fully reproduceable system. The time spent declaring that fully reproduceable system though… I remember the first time I was trying to get my usual disk setup of, a luks encrypted btrfs partition with multi-factor enabled decryption/authentication.
On a normal install it would take like a day at worse to install your distro. My first attempt with NixOS took me almost 4 days of screwing around in configs. 2 of those days were probably cumulatively spent waiting for the config option list of the nixos manual to search for text. And the number of redundant config options which all do the same thing! Or, are supposed to all do the same thing but in actuality, only one of them does the thing they are supposed to.
I really want to love NixOS but it always ends up feeling like an exercise in my patience and time to do even the simplest of things. As such I find myself asking the question of, am I going to spend so much time reinstalling my distro that it’s ever worth this initial investment?
Anyways, rant over. I actually have been debating switching back over for another try again myself I just have some very frustrating memories of my first attempts with the distro.
Interesting, my first install of NixOS was done in a few hours and included a feature that I had not used in my previous Arch install, namely secure boot. It proved to be no issue whatsoever.
I do agree though that you’re looking of lost without search.nixos.org, and documentation is lacking. E.g. did you know that enabling Plasma sets your main font to Noto, regardless if you’re actually using Plasma or just have it as an option in your display manager? Or when to enable a program or service rather than adding it to your system packages? Or that if you install plain obs and some plugins, the plugins won’t actually work?
I do understand why this is the way it is and I do think it’s the better approach. But it’s not perfect.
On the other hand, my system works very well in daily usage.
SYMLINKS
SYMLINKS EVERYWHERE
(also 6000 packages intalled on my system for some reason lol)
Well, Nix has a very liberal definition of a “package”. Your web browser, its wrapper script, a service file, a config file; those are all technically “packages” (or “derivation” as Nix calls them).
Doesn’t it have a garbage collector like guix does (
guix gc
), which cleans up everything in the store that isn’t needed anymore?nix-collect-garbage
I configured it to run every 7 days.
I didn’t get it either, but this video does a pretty good job explaining why it’s different: https://www.youtube.com/watch?v=DMQWirkx5EY