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
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.
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).
Are you still using it and happy with it? I've been increasingly setting single purpose dev VMs in 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.
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 think I will give it a try on a server first, I don’t have a playbook or script for a reproducible set up (yet), so I may as well use Nix to see if it’s worth the hype
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.
I'm pretty stable — I've just gone between Ubuntu and Arch — and other distros don't really seem different enough to actually change how I use my computer. I'd just install the WM of my choice, then just use RPM instead of pacman or whatever. The actual premise of NixOS is intriguingly different. Saying what you want the system to be, rather than saying how to change the system.
I daily drive GNU Guix instead, and I would strongly recommend any emacs and/or lisp enthusiasts interested in the benefits of functional, reproducible, declarative, and hackable system management to give it a try!
Do you run the gnu guix distro or just use the package manager? Because iirc it uses only free software, even for drivers. So I imagine it is not that easy to find compatible hardware.
I run the complete system. It's true that the standard iso comes with the linux-libre kernel and the standard channel (think repo) contains only free software. However there is the nonguix channel which comes with the full linux kernel, and all the proprietary drivers you could ask for.
Nonguix offer an ISO with the full kernel too in case you have a proprietary wifi card and don't have ethernet for the initial setup. The nonguix README I think is pretty clear, but Systemcrafters also made an excellent guide for doing this.
My wifi card unfortunately requires proprietary drivers and I have personally never had an issue with guix + nonguix for all my software needs, proprietary and otherwise.
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.
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.
because it's good as hell and i don't want to have to spend time having to rebuild and reconfigure fresh OS installs or risk breakage when I could just use a config file that I know already works
Because it’s the latest Cool Nerd Thing™ like Arch before it, and Gentoo before that. Most of the people raving about it probably don’t have much use for its features.
The features themselves are very useful for basically any user. Whether they are worth the non-standardness and issues that come with it is another question.
I'm using GNU Guix System which is similar to NixOS and I think I can safely say I do appreciate Guix's features that set it apart from a traditional GNU/Linux distro or package manager.
Declarative orchestration systems have been around for years and have a very real use case when needing to stand up servers in a replicable way. Nix is applying that approach at the system level.
I'm not entirely sold on wanting to put that level of effort into a personal desktop, but I don't think it's at all fair to say that it's not addressing real problems.
People love Nix because of the OS configuration based around a single config file. Essentially, you define your system configuration in this file, including installed programs, then you rebuild your system based on that configuration.
The beauty here is that you can easily move this file to another machine running NixOS and reproduce your configuration there. You can also roll back changes by simply rebooting and choosing the last known good build and you're back in business.
Agreed, Silverblue is great. I would love a declarative system, but Nix just doesn't make it easy with its sprawling documentation and mix of new and old parts. I was trying to follow a guide for Home Manager, but couldn't use it because they were using flakes, I was still on the "old" configuration.nix style.
You can't make all things declarative either. If I can only have things 50% declarative, it kinda defeats the point.
I also still tried to use flatpaks since nix doesn't have sandboxing and is slower on updates, but its font configuration was broken.
Nix overall feels like it's requires a lot of workarounds, moreso than Silverblue.
But hey, at least if I ever want to try it out again, I just need to copy in my configuration.nix and make things work from there.
Yup, I did the same thing. I really wanted to make it work but I think it just needs some time to mature. Once it has some clean documentation and polishing it'll be really cool.
I really liked how NixOS has a hardware config repo. I have a Framework, used the config, and everything just worked. I mean it usually does on other distros too but it's nice to know that if there's a config it'll be guaranteed to work.
I'm currently really enjoying kinoite. I think it also has some documentation issues but it's also not as radically different from your average distro as NixOS..
Never heard about Silverblue, but you may want look at GNU Guix. It is also a functional package manager and I've heard from some people that they liked the guix documentation more (not sure if that's true).
Also it uses scheme for configuration rather than some special-purpose language.
I tried it about a year ago and I don't know it did not convince me. Yeah it might be great for some niche developer oriented needs or deployment but for a normal OS usage, meh. I kind of see it as a current hype, just like crypto/NFT before, and AI now. For normal everyday usage I find openSUSE Tumblweed much more suitable and much more widely applicable.
What's the update process like? Do you have to reconfigure every configuration myself on update? I see this stuff about declaring packages and having multiple versions of stuff, but I don't get how it's sustainable unless you're on top of managing packages yourself. Like what if I have a version of network-manager and program-x that hasn't been updated in over a year that requires an old version of network-manager. Then that program gets updated, asking for the newest network-manager dependency meaning I have two instances of network-manager. Then there are other programs that are looking for a more up to date version of network-manager but not the bleeding edge one. That seems like it'll lead to a sort of quasy digital hoarding. And if you're on NixOS long enough you're just destined to run into dependency hell. Does Nix do anything to ward that off?
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).
To get it out of the way first: There are no financial issues. There are more than enough funds to continue operations as they are for a sufficiently long time.
What is actually happening is that a long time sponsor has indicated that they (understandably) no longer want to foot the huge bill of hosting the entire archive of binary caches ($9000/mo). Finding a more sustainable setup is what the community is currently concerned with.
There is no risk of operations shutting down any time soon, the NixOS foundation has funds set aside to continue even this unsustainable setup for at least a year. We just want to be more efficient with our and others resources going forwards.
That's what all this you might have heard of is about.
Btw, even if the binary cache were to go poof, we don't technically need it. NixOS is a source-based distro like Gentoo and source hosting is not a concern. The binary cache is immensely helpful though which is why we'd obviously prefer to keep it.
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.
NixOS is not immutable in the way Fodora Silverblue is, and way more declarative and reproducible than Ansible.
But yeah it is not something you "need". Other distros work too, but NixOS is way more fun.
Same. If I wanted to set up multiple PCs at once, I would definitely consider it, but for my workstation? I'd rather have the newer packages offered by the Arch repos. Even with that said, you can use KDE's apper to quickly install a bunch of packages.
I've been looking at it after numerous times I update Fedora only to have some tool break that I use daily. Then I spend a chunk of the day getting Virtualbox working again so I can do my job (write code for websites).
I haven't made the jump, but it looks very interesting.
Conda and any other reproducible computing library that relies on LHS Linux filesystem just doesn't work on it (okay it does, but more as an obstacle)
I'm okay with having nix the package manager on my default arch system though, since it is incredibly useful for cross compiling, and it let's me modify my system however I want.
I also often put the "dirty" packaged AI/python stuff (which is unfortunately quite a lot) into Dockerfiles if I don't want to package it cleanly with Nix.
It's unlike most other Linux systems I've ever used.
The central idea is declarative structures. So your entire operating system, all of the apps and systems services and other custom things you need, are declarative in one place and hopefully easy to activate.
So instead of flatpak install, you add the program to a 'text file' and rebuild your system.
Everything is using the nix package manager which has been around since long before the distro nixos.
That's only the start of the rabbit hole, but if anything sounds interesting i encourage you to check it out!
Having the option to have multiple versions of a dependency without needing to have duplicates of the same version alá flatpak seems like it should've been a no-brainer on any linux distro.
With that said I'm very comfortable with my current system, so definitely not until I get majorly fucked by my life-choices
Definitely sounds like a competent player in comparison to most distros though.
And I feel like the terminal isn't as big a barrier as everyone makes it out to be (part of why I say that is because I think the entire concept of "beginner friendly distros" only makes the terminal seem more impenetrable through that wording)
All-in-one config is definitely something I would've hoped Arch had as well, and as a bonus I would love a system that kept all things related to the user in /home (I'm not completely sure Nix does but I may as well throw that in) (homed does not do that as it still has entities outside of /home that you better back up, in fact you'll risk being locked out of your user if you don't)
Thanks for this, it was definitely a nice overview. Not the first time I'd heard of NixOS, but I do seem to be seeing more frequent and more substantial discussions of it.
What I'm getting from all this, is that it looks to be a great way to set up reproducible desktop environments. And servers too, I suppose.
What I'm not getting from this: a compelling reason to switch from established players like RHEL and Ubuntu in combination with cloud-init and Terraform and the likes of Chef/Puppet/Ansible/Salt to spin up a cluster in the cloud, reconfigure, tear down, etc.
In case anyone is misreading me: this is not a dig at NixOS. It definitely looks interesting. Like, to the point that I'll at least spin up a VM on my Manjaro laptop and see whether I should perhaps consider wiping and reinstalling with NixOS. The "configuration through code" is extremely appealing here.
My concern here is corporate inertia. And before anyone gets gets ready to launch a diatribe about how corporations don't decide what the best tech is, I will agree with you. I've been around a while, and excitedly watched as Unix ramped up and displaced platforms like VAX/VMS and AOS/VS, using smaller and faster hardware. Then along came Linux and the battle for which distros would dominate.
As for configuration through code, I've been keeping a keen eye on things (tinkering when it's been possible to do so) since the days of cfengine and Jumpstart. I used to share this site with anyone that would listen to me; it's dated now, but the underlying principles are (were?) solid: http://infrastructures.org/
So for now, I think I'll have to limit my professional NixOS usage to tinkering and potentially useful side projects. For personal usage? Yeah, it might become my daily driver, but I need to find the time to tinker.
I will say that I'm presently involved in an effort to test something out that has my company's product available using rpm-tree. Not my decision, this is all being driven by a customer that has a lot of clout; they really, really want to use rpm-tree. It's proven to be a bit onerous at times.
What this NixOS discussion has managed to do for me is to have me wondering whether a NixOS approach would have worked out better; my sense is that yeah, maybe it would have. But my feelings here might simply be the result of "woo, shiny new object", which has definitely colored my opinions of things in my career of ~35 years. Something that I've had to restrain my excitement over, pending corporate sanity checks.
I think NixOS at this point is great to know and have an eye on for new projects that happen to require some preconfigured OS "underneath". I wouldn't think about migrate existing, working infrastructure into NixOS either, 'just because'.
I was zzz until i heard having the ability to have different versions of packages installed at the same time without having the flatpak issue of having to have duplicates of the same package.
All-in-one config is definitely something I would've hoped Arch had (I just like the idea of everything user-related stored within /home because that makes fucking sense, no, homed doesnt do exactly that) so I'll definitely check it out if my harddrive ever crashes or something.
NixOS has benefits not just for developers, altough being familiar with programming is helpful.
For me the main benefit of NixOS is being able to keep multiple systems in sync. For that I have 3 config files, the first containing all general config and packages I want to have installed. The other two are for my laptop and pc respectively, which allows me to make system-specific changes. E.g. tlp is only enabled and configured on my laptop.
And NixOS isn't just rolling release, it also has bi-annual stable releases, which is great for servers.
Rollbacks are also awesome, altough I used btrfs snapshots a few years back with Arch for a similar result. With a bit of setup they are bootable from grub.
All I year about from the linux community is NixOS and btrfs, neither of which I have any interest in. It almost feels like someone with an agenda is promoting these two with how prevelant they are.
I like using btrfs with Arch because of the snapshots. If an update breaks something I can just boot into a snapshot from grub keep using my PC and solve the problem later. It's very useful... yes... very... you should try it... come... try btrfs... it's warm and cozy... INSTALL IT!
I have tried btrfs in the past and when it goes wrong you are utterly shafted. You can't even mount it as a read only file system, it will just lock you out entirely. And the support isn't great, I ended up finding something that had a disclaimer along the lines of "only run this if you really know what you're doing", but obviously I didn't as the documentation didn't tell me enough to know. So the only people who could possibly know are the developers of the file system themselves. Anyway, I was 2 days in to trying to recover my data by this point so I gave it a go, nothing to lose - it refused to do anything. Great.
The nice thing about nix and guix is that they're package managers, and so you get most of the benefits even if you're using a different OS.
I'm currently transitioning from Doom Emacs to my own config that's using guix. So far I've got
a single manifest that contains all of the Emacs and Linux packages that are needed to run the config.
The guix part is really simple, but it allows me to reproduce my config on any Linux distro by cloning a repo and running a guix one liner. A different one liner can run it in a containerised environment. Also, I can roll back to any previous time I've updated something through that manifest, or pin a specific version of a package.
And that's just scratching the surface of what you can do.
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'm really not sure of where this would be anymore usefull than a simple bash script to install all packages you need since it doesn't do configs and that rollbacks are supported by some filesystems already.
Also Having version specific dependencies is already a thing for flatpacks and such
I have to check a little harder on what it does since I saw in a vid that you still needed to add your own if statement to get it working I assumed a simple
Part of the purpose of NixOS is providing a means to build a reproducible environment that's easy to configure, migrate, and rollout. You can absolutely handle configuration of many different programs using either flakes or the native modules provided by nix. You can customize your entire system from firewall entries, to users and their shells, to the kernel itself and the kernel modules you'd want it to load, all in a single file or multiple files. If you want to try doing all those things in bash scripts, good luck and please share your experiences but don't expect it to be as easy as the Nix ecosystem.
There is a world of difference between a bash script and something like NixOS. The most important difference is that with NixOS something that you don't specify won't be there. Whereas a bash script (or other config management tools like Puppet, Chef or Ansible) only mutate things listed.
But if you remove ensure_installed python3 it will stay installed. You can try to be very careful and always add ensure_not_installed python3 but this is both error prone and dead code as soon as you run it. I used to have a script like this and I used each of configuration management tools mentioned above and always ran into these issues. The exact error flow would be something like this:
Enable/setup some service A that pulls in package X.
Disable service A or remove package X because it isn't needed anymore.
Write configuration for service B.
Forget to add ensure_installed X but it works anyways because X is still installed from step 1.
Now you have a non-reproducible config because if you try to re-install or setup service B on a new machine it won't work because X isn't present. This may sound like a niche problem but I ran into it almost every time I tried to bring up a new machine using my config.
It is still possible to do this in NixOS as it isn't completely reproducible (you can have mutable state) but in general it is much harder because any configuration that isn't specified doesn't exist. As soon as you remove package X or service Y from your config it is removed from your system. I've been using NixOS for 8 years now and this problem is mostly gone. It is definitely more reproducible than bash scripts and it has a tangible effect on my workflow.