Why everyone is switching to NixOS ?
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 !
151
Comments198Hi 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 !
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 used NixOS for a couple of years. My experience is like this:
Important to note that NixOS has both a rolling release and point release version.
Note that there's both the rolling unstable channel and a bi-annual stable release channel.
The configuration stuff seems great. I guess it reduce the struggle of porting a full config from one pc to another right ?
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.
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.
Why did you stop using it?
Nothing too major. Just already knowing how to make things work in other distros vs investing more time into learning to do it the NixOS way.
What are you using instead?
I have been using Arch and Fedora. Considering Fedora Silverblue too. Everything is working well, so not in a rush to distro hop.
Wow, that sounds really cool (specially the config thing). I'll have to try it sometime.
this comment reads suspiciously like it was written by an LLM (eg ChatGPT). was it? please don't do that!
I tried asking for sources before, and they were all wrong, either non-existant or not even about the topic, some were just random urls.
Do LLMs give citations? Otherwise, I could agree.
do they ever!
(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.)
Bing 'chat mode' (read: hooked GPT-4 to their search engine) does in essentially this format.
Yes, you can ask for them.
Yes, and it’s actually a problem. They sometime generate realistic looking, fake citations.
@[email protected] @[email protected] @[email protected] @[email protected] @[email protected] @[email protected] an admin is telling me not to use LLMs. Is this the official stance of this instance? If so, please let me know so I can find another instance and add it to the rules, if not please choose admins that actually enforce the instance rules without making them up.
If OP wanted a response from an LLM, they would have typed their question into an LLM. The least you could do is label it as such.
I use an LLM to edit everything I write. Does this mean I have to label everything as LLM-generated? I am the one doing the job, but in the end, I'm just copy-pasting the output from the LLM.
Rule or not, it's pretty lame, look at the size of your post compared to how much info it gives, had you copied a article from some basic linux news stite, it would have given mostly the same output, now think about what linking a page to an article about nixos as a response to op trying to start a conversation about it would look like, rude.
I think you should.
Why don't you label your name in every answer, so we can check if you are hallucinating or making things up?
You mean like a username that is listed in the header of every post and comment?
What?
I'm also curious why you feel the need to have an LLM edit your writing. What did you do before an LLM? And what benefit do you feel the LLM writing your comments is offering you and those reading your comments?
Using an LLM to autocorrect your own words is not the same as copy-pasting an LLM response.
I swear, LLMs are really giving people the You made this...I made this meme a rebirth.
May I invite you to consider the pitfalls of such an approach?
Yes, that would be reasonable imo
thanks for clarifying. i'm deleting your generated comment per rule 4 (spamming); if another admin wants to undelete it i would be surprised.
please do not post LLM-authored comments without clearly labeling them as such. imo this is common sense, and doesn't need its own rule, rule 4 is sufficient.
The admins did not remove the comment, a community mod did. Mods can impose further restrictions on their communities on top of instance wide rules (within reason of course), including banning LLMs. Lemmy.ml at least does not have a blanket ban on LLMs, but generally it's expected that, 1, you should not post LLMs excessively, we mainly want to host discussions by humans, 2, you should disclose it's from an LLM and which one it's from, and preferably add to what it says with your own comments or analysis. If it's a mix of LLM and your own writing, say so at the start of the comment, but if the community directly disallows LLMs then you shouldn't post it there at all.
So basically promote software for free? No thanks, bye. I won't attribute everything I write to an LLM.
I don't know whether just using an LLM is a problem. But in your case I would say the fact you used one and didn't indicate you did. If you indicated the answer came from an LLM, then the trust in the answer could be weighted accordingly by each user.
That's my opinion at any rate.
Under the soon to be enacted EU AI laws such a bot would be limited-risk application (interaction with humans), the requirements for a text bot aren't particularly high but also non-negotiable from a best practice POV: Stating front and centre that it's an AI generated post. It's also best practice to fulfil criteria necessary for high-risk systems voluntarily, the more you can fulfil I bet the less hostile people are going to be.
The library of congress has an executive summary of the thing.
(EU sources alas are a bit iffy at the moment there's the commission version and the parliament amendments, haven't seen a consolidated version yet. When will politicians start using proper VCS)
I use an LLM to edit everything I write. Does this mean I have to label everything as LLM-generated? I am the one doing the job, but in the end, I'm just copy-pasting the output from the LLM.
Try not using an LLM to write what you..uh..write.
If your sources don't match the claims no you're not doing "the job" necessary to classify things as LLM-assisted instead of LLM-generated.
You suck
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 is clearly a chatgpt post that you made references for
Nice summary, appreciate the links. Sounds like Bing AI thought ;)
It's in no way "everyone", just a vocal minority.
I use
ArchNixOS BTW.Why do I get nothing but first dates?
By the way, I use NixOS.
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.
You forgot to mention: cross-compiling binaries for other architectures has never been so easy. You can even make them static builds.
It's breathed new life into my old synology NAS which is stuck on an old Linux 3 kernel.
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 have been using for years on servers. My lemmy instance is hosted on it.
Although for desktop I had too many issues back in 2019 so I ended up back to Arch Linux and then EndeavourOS
Would be fun to try again to use it on desktop
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.
NixOS is certainly interesting tho.
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.
Atleast NixOS isnt one of the countless Arch based distros emerged since pandemic
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.
Hope that helps profligate!
Does it actually require proprietary drivers or just proprietary firmware? I don't know of any wifi cards that actually require proprietary drivers on Linux.
I run the GUIX system distribution in all my machines - other than the initial install being a bit harder it is great.
Firmware blobs yes. The default GUIX kernel patches out all proprietary blobs, but the nonguix kernel has them. I do have one machine where I also build the kernel package with my own config because the the wifi driver is not build by default in the linux kernel.
Did a quick search here, besides firmware, nonguix has packages for the nonfree nvidia drivers, brother printer driver, unrar.
In addition nonguix also packages software that GUIX does not, e.g. firefox, or third party binaries:
https://gitlab.com/nonguix/nonguix/-/tree/master/nongnu/packages
It's a source-based distribution like Arch so packages are as up to date as the package maintainers keep them. Of course anybody can go in and submit a newer version of a package if the original packager has been slacking on updating. You can also use your own custom version of the package by just copying the package definition, bumping up the version number, and then installing it with
guix package -f my-custom-package.scmI will continue to use Arch btw...
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.
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.
Not even remotely close
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!
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.
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.
Solution without a problem. A cool solution but yeah.
I don't think that's accurate, personally.
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.
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
They're not but nixos users are REALLY loud, as in, they can't spend a single day without talking about it.
New Arch. Both still worse than Silverblue.
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.
It's been around for like a decade, but was recently make more approachable by offering a graphical installer.
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
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?
Its getting better which each release
nah
didn't have enough time during the last half a decade to learn yet another thing
might be better fit than my current debian setup - but how would I ever know, since my current thing is good enough?
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?Yep, Nix-store -gc or some such will do something like this.
nix-collect-garbageI configured it to run every 7 days.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.
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.
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 mostly agree. I have been using NixOS for quite some time now. I am a home user with some Linux knowledge :)
Hmm, I've never heard of NixOS. Is it suppose to be like blendOS or CurtainOS? A blend of different desktop environments?
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!
Hmm, a very interesting approach indeed.
When you say rebuild, does it have to rebuilt everything? If so, is it quick to do so?
It checks everything that has changed since last build and it changes only what is needed, I'd say 30 seconds or less normally. When updateing, you can end up updating all of the packages on your system at once, which of course is dependent on your network speed / sometimes compile time, but for me it can take around 10-15 minutes in that case. On a slow network, with a laptop CPU.
But you get atomic rollbacks so any breaking changes can be rolled back just by rebooting and selecting a different build.
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...
To clarify, Manjaro Linux with proprietary drivers works just fine with my 3070m. It's NixOS that doesn't work for some reason.
I ran it in a VM for several months and was underwhelmed. Sticking with Fedora.
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.
I've made the jump twice, and jumped back twice.
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.
Have you tried putting it into a buildFHSUserEnv?
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.
I did, but it still doesn't quite act right, especially if I need to build extra packages within the environment
What about Nix's financial issues? Have they been resolved yet?
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.
I think AWS Gave them 12 months of free credit to host cache
Yes, AWS gracefully sponsored 12 months of our S3 bill which gives us even more time to enact change.
That's just the short term resolution though, the Nix community is still looking into more sustainable long-term solutions.
$9,000/mo? Have you considered not using the most ridiculously expensive method possible?
Thinking about this further..
I can purchase 10GE fiber, at home, for $299/mo.
I can purchase a solid 16 bay Supermixro server for around $5k
16TB drives are $168. There's $3,700 left so let's buy 21 drives (336TB, 235TB usable under raidz3 zfs). We'll leave that last $170 for .. electricity.
Leasing all of this from a regular hosting provider woul be much more cost effective. I work for one, what the heck are you doing man?
You aren't a reputable public hoster with AWS-class uptime. That has a price too. AWS is likely overpriced though, hence the nix community still looking for better alternatives.
I actually read somewhere that Void Linux is the (not so) new up-and-comer...
For those who like a video format, I found this introduction quite informative.
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)
https://github.com/nix-community/home-manager ;)
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.
Great points and perspective!
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'.
It occurred to me that NixOS might have a hard time doing something like this:
I can see NixOS doing a fine job of templating a standard build that includes the Docker engine. But working out which one gets to init the swarm, which ones get to join as managers, which ones get to join as workers? Yeah, that's probably better off left to something like Ansible.
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.
Answering that question fully would require a PHD thesis.
Perhaps you could narrow down your question a little?
I don't get the hype. I'm staying with Arch, as Nix seems to be mainly for developers.
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.
I'm using Void Linux and see no reason to move over to NixOS. The concept seems cool though.
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.
Yeah, I'm using the Nix package manager for software that isn't in the repositories, on Void.
Overlays. Good package management, and lot of stability stuff.
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.
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.
So in summary I'm not going to try it again.
can confirm, I've recently had my btrfs partition on NixOS go permanently read-only because it ran out of metadata space (which you can't extend without write access, even though btrfs does reserve 0.5GB of metadata space) so I've switched to bcachefs
Well, I've been sold on sold on btrfs for over a decade. If you're telling me NixOS is just as great I just might have to give it a try.
I love both, but if I had to give up one... I'd give up btrfs over NixOS in a heart beat. Put me on a FAT32 NixOS system if you must...
It's cool, but I'm a happy Pop OS user.
I am waiting for OpenSuse Leap 16.(mainly because of my wired GPU Setup I just couldn't get running on other Distributions)
Never tried NixOS but I think I will try Qubes-Whonix next: https://www.whonix.org/wiki/Qubes
I don’t know NixOS. My Linux machine runs Pop_OS and Manjaro.
What are the pros and cons of NixOS ?
They don’t know about Debian stable.
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
A simple bash script is not reproducible or deterministic. Also a filesystem rollback is not the same as NixOS's generation based rollback.
Also, NixOS doesn't just install packages, all system configuration is done declaratively, which would be a very bad idea to do via a bash script.
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
pacman -Qk xorg-xrtrop 2> /dev/null && sudo pacman --noconfirm -S package1 package2 package3 || echo 'I aint got no x, idiot'would do the job as well
I'm not familiar enough with Pacman to know what that command does. It's definitely not as clean or easily manageable for servers as NixOS is. Especially not when you have multiple systems of which you would like some packages to be shared and others not. It also still doesn't allow you to manage global system configurations.
this one just checks if xorg is installed and installs a few packages if it is, or call the user an idiot if it isn't Nix seems to be really good if you need more than a personal os
I'd recommend reading some more; especially w.r.t. imperative vs. declarative.
In NixOS, you'd do something like this:
You don't need to understand the exact semantics here but you can look at it like JSON but with functions. This is not a "program", the end-result is just data. You're not modifying some stateful system state with new state from an uncontrolled source (i.e. the Arch repos) but rather just "outputting" a different dataset.
NixOS then builds a concrete system out of this pure data specification. In this concrete system, those packages' executables are available in the "global" PATH.
You say "I want a system where x y z are installed" and it does it for you in a standardised manner. With the bash script, you explicitly tell it each step ("install x; install y; install z"). This pure data nature is what's meant by declarative.
This distinction rules out whole classes of issues you simply cannot run into with NixOS.
Another aspect is that, as long as you use the same revision of Nixpkgs and the same config file, you can re-create the exact same system (almost bit-for-bit). If you were to run your bash script in a year's time however, you'd get an entirely different system with totally different revisions of software and therefore possibly entirely different behaviour.
This is what's meant by reproducibility.
You can achieve some of the same things NixOS does using imperative tools but nowhere near the same quality.
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.
so it does handle more than just conditional packages like the other zealots make it sound like
Wayyy more. You can move all of your dotfiles to Nix config. And deploy it with Nix based infrastructure.
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.
So it is very easy to write a script like:
But if you remove
ensure_installed python3it will stay installed. You can try to be very careful and always addensure_not_installed python3but 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:ensure_installed Xbut 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.
I wrote a blog post about it a long time ago but the core is still relevant: https://kevincox.ca/2015/12/21/service-management-with-nixos/.