Hacker News new | ask | show | jobs
by ildjarn 824 days ago
Last I tried to use Nix there was lots of confusion over flakes - some tutorials suggested using them and others saying they are still in development.

Has the situation improved?

3 comments

I believe so, it seems like almost all (or all?) solutions listed here: https://news.ycombinator.com/item?id=39696038 use flakes underneath.

I think the flakes problem come from two things:

- flakes are labelled experimental for years now (I think it might be almost 5 years now) which creates confusion with new users, but they are universally used nearly everywhere now - there seems to be some bad blood[1] between https://determinate.systems/ company and the long time Nix users and developers who are accusing them that they are using Nix for their benefit with not contributing back. From my understanding Determinate Systems introduced flakes and probably this why there's some resistance to it by some.

But to answer your question, pretty much everyone adopted flakes and guides that don't use them are most likely old.

[1] https://discourse.nixos.org/t/introducing-flakehub/32044

DetSys founder here :). Firstly, congratulations to Flox on the launch.

DetSys is founded by Nix's inventor Eelco, and me -- a fairly long time community member (since ~2016.) We're also loaded with long term Nix users and contributors. We (the company) didn't invent flakes, and I didn't have anything to do with it either. While working at Tweag, Eelco worked with Target to develop the idea.

I'm not sure where this idea of bad blood or not contributing back comes from, either. The vast, vast majority of our code and products are completely FOSS, and our most popular product (the Determinate Nix Installer) is deliberately licensed in a way that upstream Nix can take it and integrate it however they want, any time they want. And I hope they do! We also invest heavily in contributions directly upstream. We're long time open source contributors and advocates, and that doesn't change now that we started a company.

I think there is a lot of compression of time and history here that has lead to lot of pretty baseless accusations and confusion. I think some people who don't like the change don't like it because they've built their own mechanisms to get what flakes provides. That's fine, nobody has to use flakes. The old ways aren't going away. Some folks don't like them because they're not technically perfect or bug-free. That's fine, too, but they're not becoming more stable by pretending flakes don't exist.

I look at threads like the one you linked as evidence we're doing something interesting. Nobody would care if what we were doing was useless.

One point that is absolutely true, though: DetSys is 100% contributed to the version of the future where Nix + Flakes is the thing. Flakes solve such vast problems that I feel there is no going back. This is the basis for the Determinate Nix Installer: we guarantee flake stability, and use the installer as the wedge to keep that promise with our users. This promise has been the basis of our work on FlakeHub and our just-launched-today FlakeHub Cache.

Unfortunately, nix.dev -- an official Nix documentation source -- specifically does not teach much about Flakes. To the degree of introducing documentation for unmaintained tools that see very low community adoption: https://nix.dev/guides/recipes/dependency-management.

We've taken a strong position on flakes by introducing our installer and zero-to-nix.com, a flake-first documentation source because of this confusion. I have asked numerous times for the various Nix leadership teams to make a choice on if flakes are the future or not, but as we can all plainly see: they have not chosen to do so. This confusion about flakes comes from the very top, unfortunately. I find this very motivating for building the best Nix company I can, to support the adoption of Nix and flakes in interesting places around the world.

Ah, apologies for getting things wrong. Thanks for explaining it and making it clearer. I just saw the hostility in that thread and that's how I interpreted it.

BTW: I have nothing to do with Flox, I'm just ordinary Nix user who actually likes flakes and also wishes it would get removed from the experimental flag. At this point I agree there's no going back. If flake was removed tomorrow there would be a huge uproar and countless of setups broken. The ship already has sailed and continuing on keeping it behind experimental only undermines what "experimental" supposed to mean.

I don’t know anyone who is recommending against flakes these days. The “experimental” label is more about the API stability than completeness, bugginess, or anything else.

There are certain scenarios where the performance can be problematic, but there are workarounds and permanent solutions are being worked on. Nevertheless, using flakes extensively at home and work.

>I don’t know anyone who is recommending against flakes these days. The “experimental” label is more about the API stability than completeness, bugginess, or anything else.

"Experimental" traditionally means "if you use it and it breaks, then that's your fault". This is because if <experimental thing> did break, the entire internet would dogpile on any complainers with "IT WAS LABELLED EXPERIMENTAL WHAT WERE YOU EXPECTING."

It's the same as ignoring Kickstarter warnings; if a project gives you a warning then tell you to ignore that same warning, don't; if things go to shit then everyone will say "YOU WERE WARNED WHAT WERE YOU EXPECTING." They cannot un-warn you, that's not how this social situation works. I'm not claiming this is fair, I'm just claiming this is how it plays out in practice.

The only safe response to this is to assume that anything labelled "experimental" is exactly what it says. And to be clear, that means the only safe response is to ignore any claims that the thing labelled "experimental" is safe.

Or to put it another way: if you don't mean it's experimental and do recommend it to the average user, then don't use the term "experimental".

Here's the closest thing to an 'unwarning' that can exist, which is a tl;dr of the history:

The experimental label is a historical compromise because flakes, which was conceived by the original author of Nix (who is still a maintainer), was a major change merged to master without going through the whole Nix community RFC process (which was then in its infancy).

So it was added, but tucked away behind an 'experimental' designation and enablement flag. This proved controversial at the time and perhaps still is among old timers, but in the interim flakes have become enormously popular with new users (probably most people who picked up Nix in the past 3 years or so).

Third-party adoption of flakes has by now reached the point that the vast majority of big tools in the Nix ecosystem support it well. Some interfaces are still officially unstable but serious breakage is pretty rare. The flakes implementation in the codebase is very usable but still incomplete and still a bit buggy, and straightening out the kinks in the implementation as well as stabilizing the interfaces (both for Nix code and the CLI) is careful, patient work under way right now.

Hence the common recommendation to just use 'em unless you have deep Nix knowledge and a specific reason not to.

See: A plan to stabilize the new CLI and Flakes incrementally https://github.com/NixOS/rfcs/pull/136