Top
Best
New

Posted by birkey 3 hours ago

Why I love NixOS(www.birkey.co)
85 points | 69 commentspage 2
atcol 2 hours ago|
NixOS is great. Nix the language is just awful. I still use it for my Dev laptop and for Home Manager on all my devices.
loremm 3 hours ago||
This is niche and HN is full of these back and forth comments. One thing which a particular type of crowd will appreciate is being able to apply simple patches to constantly-up-to-date packages.

For an example, I love atuin but it, by default, skips commands starting with space. Currently it's not configurable and while I wait for time to submit a PR or for the issue to be resolved, make a single line `patch` which just removes the part of the `if` statement which checks if it starts with space. So easy, took 5 minutes (also had to comment out 1 test).

And now on home-manager debian or nixos server, I get up to date atuin with that one patch. It downloads rust, etc, compiles, and then that's garbage collected away

0x457 2 hours ago|
Same but with kernel. What lead me to nixos: company gave me a laptop with iGPU that wasn't supported by any released linux kernel. There were patches waiting to be merged, with nixOS making an installer image that supports my machine was simple.
quchen 3 hours ago||
The idea is so good it’s as close to platonic as it gets. The user experience of writing your own nix expressions is so bad that it makes me angry every time I try. Not only that, but at some point the beginner help (!) meta became »use flakes, don’t do what the existing tutorials tell you, yes flakes are unstable beta and there are no tutorials but use it I beg you«. No, please, let me choose my own way to learn!

I haven’t given it a shot in the LLM age yet though, and trying out NixOS in a VM is not only easy, it is practical – in the sense that when you’re happy, you can simply boot that same config/OS anywhere else by just installing that config. And I’ll never forget that one time where I completely borked my everything in the VM, did a kernel rollback with like 3 command line args and a reboot, and the OS was, well, rolled back. As I said, almost platonic.

What I can recommend is using nix-the-package-manager. Whenever I need the newest version of something, `nix-env -i <whatever>` and it’s there and works. If it doesn’t, roll back. If I need a different version, that’s on nixpkgs as well, with the same negligible amount of friction.

MarsIronPI 2 hours ago||
I'm not sure if I live in some kind of parallel world, because I never had any problems grokking Nix or NixOS. I started with this book[0] and haven't ever really been confused.

[0]: https://nixos-and-flakes.thiscute.world

linsomniac 2 hours ago|||
>I haven’t given it a shot in the LLM age

I haven't tried it in almost a year, but using Claude Code for setting up my nix config back then worked amazingly well. I've only dabbled in NixOS, and I'm very tempted to it for my workstation when I reinstall it in the next month.

Given how much Claude Code + Opus have improved in the last year, I'd give it a fighting chance to make a nice Nix config. I'll probably start setting up a spare laptop to get the base configs dialed in before switching over to it.

bspammer 2 hours ago|||
LLMs are a real gamechanger for Nix, highly recommend giving it a go again.
colordrops 3 hours ago|||
Flakes are de facto standard at this point. Expressions are easy once you get used to them - in fact the Nix language grows on many of us, including myself, once you internalize it.

Using AI to generate Nix config is a superpower. Because the entire system is declared in a single set of config, you can basically spell cast any system you want. I one-shotted a Linux distro with custom branding for boot, installation screen, and login screen, and VPN and dev tools installed and configured by default, at a fortune 500 tech company.

Pay08 3 hours ago||
Obligatory Guix plug. I've found it way easier to understand, but it has teething issues that NixOS doesn't (latest for me was a few problems with DMs). And according to an acquaintance of mine, it works reasonably well with an LLM.
soumyaskartha 3 hours ago||
Most people who try Nix either quit in the first week or never go back to anything else. There is no in between.
Daunk 3 hours ago|
What would the in between be?
jwiz 2 hours ago|||
Use it for a month or two and decide it's not for you.

That is in between "use it for very short period of time" and "use it forever"

Diti 3 hours ago||||
Using a regular mutable system and Nix on top using Home Manager for example.
Imustaskforhelp 3 hours ago||||
Gobolinux comes to mind.

If you don't mind a very limited set of software, the way tinycorelinux is setup can also allow multiple different tcz installed

These two Linux distros essentially allow two different versions of same software/libraries (glibc/python whatever) installed

(Gobolinux explicitly states that whereas I find it to be an unintended but elegant consequence for tinycorelinux but I recommend taking a look at Gobolinux)

DanielVZ 2 hours ago|||
Using it for a year or so and then try another OS is my guess
moonlion_eth 2 hours ago||
nixos is love. nixos is life. once you grok it, there's no going back. see you on the other side.
fareesh 3 hours ago||
doesn't it use up a lot of disk space compared to other distros because of the way everything is set up?
bspammer 2 hours ago||
Yep disk space and learning curve are the two major downsides to Nix. The former has never been a problem for me in practice, just run garbage collection once a month. The latter was a big problem, but is now mitigated for most people by LLMs.
Pay08 51 minutes ago||
Disk space is not an issue as long as you don't try to install the entirety of Texlive.
Valodim 3 hours ago|||
Yes. But disk space isn't exactly the most valuable resource you have as a developer/power user
exitb 2 hours ago|||
Yes, however the space is not „used up” in a classic sense. It’s a cache, so you can give up some of it and reclaim your space. Fresh after a full cleanup it won’t take much more than a regular distro.
moonlion_eth 2 hours ago|||
actually once I garbage collect, nixos actually uses up less disk space for me than other distros
dandanua 2 hours ago||
Use nix.optimise.automatic = true in the config and perform nix-collect-garbage if necessary. With this it doesn't take much.
BoredPositron 2 hours ago||
The problem I have with nix is that I just don't need another hobby. Keeping everything up to date in an ever changing environment like an os just looks like chore. I install my system and image it every week and keep maybe the initial and a monthly snapshot. Why would nix be better in my case? Maybe I am missing something essential but I also don't bork my system that often tbh.
chickensong 39 minutes ago||
Nix isn't really much of a hobby. It does require some learning because it's different, and front-loading the work to build your config, but after that it's amazingly reliable and easily extendable. You can keep everything up to date with a single command.

The advantages:

- Declarative code describes your system. Maybe your install + imaging flow is good enough, but there are many reasons why it's technically inferior. There's no need for imaging Nix, because it's always reproducible by default. Rollbacks are rebooting to a previous config, not a timestamped blob of snowflake state.

- It replaces whatever tools and glue you have to build your system. You don't need to worry about bootstrapping tools, or config management tools' version compatibility, or bespoke ordering of imperative steps to build the system. All the management tools are built into the system. Everything "just works" automatically.

- If you manage multiple machines the benefits are compounding.

- There are other interesting bits that are covered in the article, that you get for free just due to the nature of nix. It's good for building, and has no friction to experimenting with specific tools or environments, without polluting your system.

It's a commitment to get past the initial learning and config build, but afterwards it significantly lessens the "hobby" aspects of computer management. There are just entire classes of problems that don't exist for Nix. Either your config works, or it doesn't, and the rollback guarantee is explicit and built-in.

overtone1000 2 hours ago|||
For me, it's the difference between taking your medicine a bit at a time on your own schedule or taking it all at once as an unwelcome surprise. Sure, setting up file system mounts or adding udev entries is easier to do once in Ubuntu than in NixOS, but I only need to do it the one time with NixOS. Thereafter, the config serves as both documentation and backup. For a hobby self hoster like me who occasionally shoots himself in the foot and has to rebuild a system, it is ideal. I don't know if it really saves me time, but I do know it saves my sanity.

I am no nix whiz, but it's the only OS I run outside of containers. Anything I can't easily get with my nix config I shove into a container, run it as a quadlet, and call it good.

Pay08 49 minutes ago|||
The configuration system is way more stable then it seems. You write it once and then pretty much never touch it again.
hombre_fatal 2 hours ago|||
Imo it's the opposite. Since the system is defined in config files, an AI agent can look at live system state/errors vs. the config file and do all the work of figuring out the issue.

Also, using higher level modules like home manager makes things more declarative and less fiddly since someone else is maintaining the lower level.

Maybe nix is a downgrade for what you do. But I loved nix so much that I also migrated to nix on macOS (nix-darwin). No more homebrew.

qiine 2 hours ago||
nixos updates tend to be a lot less eventful than others distro, in fact the way it largely prevent system borking when updating, is spiritually freeing.
erichocean 3 hours ago||
What I'd like to see is Omarchy implemented via the Nix package manager. (Seems like a good project for AI, actually.)
shevy-java 1 hour ago|
NixOS kind of extends the idea of reproducible builds. Any snapshot could be a guarantee that things just work. This can also be extended onto the user base - if one user has solved a problem, it should be solved for all of them. So we can jump from guarantee to guarantee here.

My only gripe with NixOS is Nix. I think that this is also the biggest drawback of NixOS. I don't have an alternative; but perhaps it may be better to allow any format to be used, rather than force nix onto everyone.

Another issue is that, for a reason I don't quite understand, a few years ago NixOS' quality appears to have gone down, e. g. nobody cares about documentation anymore. This is probably not a huge obstacle per se, but I did not feel I should invest that much into nix (which I dislike) when the documentation leaves a lot to be desired. Ironically this also means that the whole idea behind NixOS, falls flat, if the documentation is poor. They really should make the same guarantees for their documentation, just as they do for the software ecosystem too.

Nobody cares about documentation anymore though - AI has won. Just try finding high quality documentation via google search; it is slop world now.