Live data from Hacker News

NixOS: A Personal Post-Mortem

nathan-kim.org

31–40 of 41 posts

Re: NixOS: A Personal Post-Mortem

#31
post #15

Thanks for the great write-up. As someone who somewhat recently got into Nix I've struggled with many of the same problems. With the whole "your system is read-only" bit, I'll add that Nix can make trial and error editing of config files quite tedious. Editing and reapplying the configuration is fast, but not as fast as editing a file and `systemctl restart`ing the service in question. On development environments I'v…

> Then comes Python, which introduces the same nightmares which the author experienced. Python packages that use system shared libraries are troublesome. The nightmares come from pypi packages and their assumptions that e.g. the particular version of `libfoo.so` that happens to be in your `/usr/lib` at the time of installation is the one you need it to link against, which is a very crass assumption in 2023. Nix doesn…

> because the nix view is that it's absurd having 7 different package managers fighting for control of the same system

And addresses that by becoming the 8th different package manager fighting for control of the same system, a la https://xkcd.com/927/

Re: NixOS: A Personal Post-Mortem

#32
post #9

I've never used NixOS, so I have no horse in this race, but I'm not sure this write-up is entirely fair. The first issue you describe is that you already have alternative Nix-like solutions in particular domains (R packages), and Nix let you continue using them. Is this not desirable though? You have the choice of letting Nix handle this, or carving out a Nix-less niche to continue using existing / more cross-compati…

Great comments, thanks for the feedback! Pretty much all your points are fair. I will just say that this post is just a personal reflection and not meant to degrade NixOS as a system for others, as I wrote near the end of the post. 100% agree with the point that it just required more tinkering than I was willing to work with. As for your specific points:

1. This is a bit off, Nix does not exactly let me continue using existing tools. NixOS' dependency system means that the R dependency management system I was using (renv) would not work on its own. renv would try to compile R libraries but would fail because it could not find dependencies

I accept that Nix provides a way to handle this problem through buildFHSUserEnv, but the point I raised in the post was that buildFHSUserEnv feels hacky and unparadigmatic. I conceded, through additional NixOS configuration, that I couldn't use NixOS' store or use the NixOS recommended way of installing R libraries

2. Yep, not surprising at all, definitely to be expected. The point I wanted to make in the post was that NixOS makes it harder to tell whether it is a Linux or game-specific issue or if it is because of NixOS

Also, even though it wasn't surprising in the least, it was still a major annoyance/frustration

3. Not all captive portals, most just used a 302 HTTP redirect which works without trouble, but some were weirder -- although I'm beginning to think that this was because I didn't have `networking.useDHCP = true` enabled, as I wrote in another comment

Re: NixOS: A Personal Post-Mortem

#33
post #15

Earlier quoted context omitted.

> Then comes Python, which introduces the same nightmares which the author experienced. Python packages that use system shared libraries are troublesome. The nightmares come from pypi packages and their assumptions that e.g. the particular version of `libfoo.so` that happens to be in your `/usr/lib` at the time of installation is the one you need it to link against, which is a very crass assumption in 2023. Nix doesn…

> because the nix view is that it's absurd having 7 different package managers fighting for control of the same system And addresses that by becoming the 8th different package manager fighting for control of the same system, a la https://xkcd.com/927/

Except the entire argument here is that it doesn't cooperate very nicely with other package managers so I'm not sure how your point holds together.

Re: NixOS: A Personal Post-Mortem

#34
For the record it is not correct that NixOS's choice to store language packages in its own repos is unique: Slackware does this and IIRC Ubuntu and Debian both do this. In fact, this is so common that I occasionally see warnings on package websites telling you not to install it from your distro's repos specifically because it will be out of date.

Re: NixOS: A Personal Post-Mortem

#35
post #15

Earlier quoted context omitted.

> Then comes Python, which introduces the same nightmares which the author experienced. Python packages that use system shared libraries are troublesome. The nightmares come from pypi packages and their assumptions that e.g. the particular version of `libfoo.so` that happens to be in your `/usr/lib` at the time of installation is the one you need it to link against, which is a very crass assumption in 2023. Nix doesn…

> which is a very crass assumption in 2023 No, I think it's a very sensible assumption. As far as I can see, virtually every GNU/Linux OS has shared libraries in /use/lib, and it even has crude support for versioning. When these assumptions break with Nix, I'll grumble about it, but I won't blame it on the original package. Nix's approach is a break from the norm, so really it has the responsibility of maintaining co…

> No, I think it's a very sensible assumption.

The problem is it's an "assumption" that is rarely easy to correct when it's wrong.

> As far as I can see, virtually every GNU/Linux OS has shared libraries in /use/lib, and it even has crude support for versioning.

If that were a satisfactory assumption there would be no need for sledgehammer solutions like docker.

> it even has crude support for versioning.

which is extremely unstandardised and frequently goes very wrong and will end up compiling against a mismatched set of headers and libraries.

> Nix's approach is a break from the norm, so really it has the responsibility of maintaining compatibility.

It doesn't really have any responsibility for anything apart from doing what its users want from it. And by and large it does that.

> the existing standard Python tools everyone uses

The "existing standard python tools" (pip, virtualenv, pyenv, tox...) are ~5 different attempts at solving the same problem, but each time failing to do so, giving rise to yet another tool. Properly applied, Nix can address all of them.

It really doesn't sound like you want Nix at all - you appear to be arguing for the de-facto standard approach from the last 2-3 decades, which is not what Nix is. It is a deliberate departure from that. These design decisions that appear to annoy you aren't arbitrary choices that Nix people made to be difficult, they are core to how Nix works.

If you want something that will present a facade that it's a linux system from the last 2 decades while still appearing to give you some of the advantages of isolated/pseudo-reproducible environments, what you want is docker.

Re: NixOS: A Personal Post-Mortem

#36
post #33

Earlier quoted context omitted.

> because the nix view is that it's absurd having 7 different package managers fighting for control of the same system And addresses that by becoming the 8th different package manager fighting for control of the same system, a la https://xkcd.com/927/

Except the entire argument here is that it doesn't cooperate very nicely with other package managers so I'm not sure how your point holds together.

Except not a single other one of those package managers cooperates very nicely with other package managers either so I'm not sure why you'd believe my point doesn't hold together.

Re: NixOS: A Personal Post-Mortem

#37
post #9

I've never used NixOS, so I have no horse in this race, but I'm not sure this write-up is entirely fair. The first issue you describe is that you already have alternative Nix-like solutions in particular domains (R packages), and Nix let you continue using them. Is this not desirable though? You have the choice of letting Nix handle this, or carving out a Nix-less niche to continue using existing / more cross-compati…

I’ve been using nixos for a solid 2 years. I was introduced to nix 5 years ago when a developer at a company I worked for introduced it for one of the developer environments. In those 3 intervening years, I went from thinking that nix was incredibly stupid to thinking that nix had some good ideas and I should try it. All of that is to say, that I have some knowledge of nix. I think most of the criticisms are fair.

Developer environments are my favorite usage of nix. To me, they deliver on the promise but, there’s a big caveat, dealing with languages that need native libraries is a real pain. The mentioned buildFHSUserEnv is basically a last resort. There are better solutions but they require a great deal more fiddling. I find that my start up time for getting a developer environment going is very long, sometimes 10x longer than just installing it in Ubuntu on a fresh vm. I find it is worthwhile to go through this process as I then don’t have to worry about being able to recreate it or switch between very incompatible projects. Luckily for me, the ecosystem that I frequently have to deal with this with is python and poetry2nix works pretty well (with some rough edges). mach-nix made this even easier but it is abandoned in favor of dream2nix which isn’t ready.

The learning curve for nix is intense. It is incredibly unfamiliar and useful information is widely spread (the main documentation was too dense for me to comprehend when I started). Read the post, it seems to me that the author never got over the learning hump into it actually being useful. I think that is a perfectly rational choice, it isn’t the right thing for everyone. The one thing that kept me going through the first year of the learning process was one of the things that the author didn’t find important, being able to boot to a previous configuration. I don’t have to worry about updates that break something or making a bad configuration change. If I update my system and something breaks, at worst, I can simply reboot to revert to the previous configuration until I’m ready to troubleshoot the issue.

Nix also does itself a disservice but not promoting flakes as the nix way. Using channels makes reproducibility much worse.

Re: NixOS: A Personal Post-Mortem

#38

I find the nix language beautiful. The vast majority of the issues I have faced have been down to nixpkgs. Of course, nixpkgs is an incredible project, but it lacks direction, uses bad practices everywhere, and pretty much all of the flaws you’d expect on a vast monorepo with a somewhat laissez-faire management approach. Oh, one other problem I had, I guess, was when MS removed a link to a Teams binary that was baked…

I presume that your system refused to switch into a now-broken system sans Teams? To me that seems like a huge win -- refusing to leave you with a broken or otherwise half-configured system.

And if something did break? Rollback from the boot screen and you should be back in business (until you figure out how to pull in an overlay).

Unless I misunderstood the predicament with which you were left.

Re: NixOS: A Personal Post-Mortem

#39
post #12

I keep having to say this to people - if you're unsure about nix/nixos, "diving in the deep end" and using nixos as your desktop operating system is probably just going to annoy you. I really suggest using nix on a regular distribution for a good while beforehand. Of course, IMHO, servers is where nixos really shines.

Interesting take.

For me it was quite the opposite, regular Linux distributions annoyed me because after having them set up, some stupid mistake (either from my side, or from upstream, unsure about this) caused my whole bootloader to break, rendering my system unrecoverable (maybe not for every, but for me it was/is).

When i learned about NixOS, allowing you to essentially set up your whole system declaratively, it was so compelling to me, that i just went with it. Yea i don't really like / know the language very well, but it's a lot better of an experience than any prior Linux experience i made.

Re: NixOS: A Personal Post-Mortem

#40
post #9

I've never used NixOS, so I have no horse in this race, but I'm not sure this write-up is entirely fair. The first issue you describe is that you already have alternative Nix-like solutions in particular domains (R packages), and Nix let you continue using them. Is this not desirable though? You have the choice of letting Nix handle this, or carving out a Nix-less niche to continue using existing / more cross-compati…

I’ve been using nixos for a solid 2 years. I was introduced to nix 5 years ago when a developer at a company I worked for introduced it for one of the developer environments. In those 3 intervening years, I went from thinking that nix was incredibly stupid to thinking that nix had some good ideas and I should try it. All of that is to say, that I have some knowledge of nix. I think most of the criticisms are fair. De…

@btobolaski, I'm most interested in nix for creating reproducible dev environments. Do you have any public Python/Poetry2Nix projects on Github that I can look at?
Post reply on HN