-
-
Notifications
You must be signed in to change notification settings - Fork 73
What are your thoughts about flake stabilization? #112
Comments
I am in favor of making the I think because the old CLI was so stable, we are very attached to the idea of getting everything about the new CLI and flakes totally right from the start. To the point where we are sitting on these things for 4 and a half years now, which creates a whole bunch of other issues and uncertainties in the ecosystem. There is a wide range of things we can do to make sure users have a good experience between the extremes of
So we should ask ourselves not only
|
The One example of what I'm talking about is the |
I personally believe that NixCpp misuses the "experimental feature" concept as a way to avoid the headache of providing stable releases (same has been seen recently with the notion that NixCpp is a "reference implementation"[1]). Instead, NixCpp should stop feature gating behavior that has obviously seen wide adoption. At the same time, it should add feature gates for the most unpolished parts, such as Then, new breaking changes should be feature gated as well, and when they're ready to be shipped, or a substantial portion of the community has changed over to the new behavior, the gate(s) should be removed on the next major version. I'd suggest making new major versions on some reasonable release schedule, e.g. in time with the nixpkgs xx.05 and xx.11 releases, or perhaps just once a year at either of those. There guarantees would lead to a much more stable experience. Also, it would grow confidence, and perhaps restore trust in the ecosystem, and ideally, we'd live to see a time where nixpkgs had a NixCpp version above [1]: Other famous examples of this cop-out are Mastodon and Element, to the detriment of the quality of those projects. [2]: I would be strongly opposed to any top-down restrictions about which Nix implementation should be the default in nixpkgs, it should be the one serving the contributors and users, and community at large the best. |
I fully support stabilizing both nix-commands and flakes. More specifically, I want to stabilize flakes as a “v0” version. This allows us to establish a stable foundation while identifying and addressing the design flaws and limitations that have persisted in flakes up to this point. Looking forward, I envision a “flakes v1” that could incorporate breaking changes to resolve these issues, while maintaining the flexibility and utility that flakes bring to the Nix ecosystem. For a “v1” release, I believe it should be marked under experimental features to allow for more iterative and transformative improvements without impacting the stability of “v0.” By separating “v0” and “v1” in this way, we can ensure that flakes continue to evolve, guided by community feedback, without sacrificing the stability that users currently rely on. I believe this approach will let us experiment and refine while keeping the existing system robust for current users. |
I was a bit on the fence about this at first, but as I continued writing my response...I kinda changed my mind. I do not believe Flakes should be stabilized yet.1 For reference, I moved to Flakes pretty quickly after I started using NixOS in ~2 months. I vastly preferred it over the stable CLI, using basic fetchers for dependencies, and most of all I enjoyed the organization it gave Nix projects by introducing (mostly) standard outputs for consumption. But as I went further down the rabbit hole over the years, I came to better understand some of the flaws of the current implementation and the very large room for improvement. Some of my favorite sources for describing these are @lf-'s amazingly titled blogpost, "Flakes aren't real and cannot hurt you: a guide to using Nix flakes the non-flake way", @lheckemann's talk at last year's NixCon, "What Flakes needs (technically)", and @samueldr's blogpost, "Nix Flakes is an experiment that did too much at once…". And while I may not agree with every single point brought up in these, I highly recommend anyone reading this to go give them a read/listen/watch; they're great! In any case, some points from the above sources I feel strongest about are:
Some of these may be done without introducing backwards incompatibilities, while others not so much. I think this is the power of the current "experimental" flag, though -- even if it we haven't used it as much as we could. We still have room to make these changes and not push out a feature still containing a number of core issues with the promise of it being "production ready". However, I am very well aware of how many users depend on Flakes in production environments already -- including myself in probably 99% of personal and collaborative projects. That's why I strongly believe breaking changes must be made thoughtfully and only where necessary, but still encouraged in order to reach an actually stable state. As lheckemann said in his talk, we must avoid changing widespread patterns that would break evaluation of Flakes (unless they fix ambiguities (see the point on registries above)) and "the errors that get thrown should come with clear explanations of what was broken, why, and how to make things work again." Lastly, any effort to stabilize Flakes should heavily involve the Nix team. Quoting samueldr from the above blogpost:
Footnotes
|
Most of what needs to be said has been expressed above. I'll only add that the Nix team's current approach to this problem is: (1) trying to fill the remaining gaps in nix-command and (2) to finalize the semantics of fetchTree, a cornerstone of flakes. Oh, and if anyone would like to pursue fixing any of these, or any other outstanding Nix issues, feel free to reach out or contact the team! |
I see this as one of the more urgent issues of the ecosystem: It's not only an annoyance for users but for new-comers, the question why a feature that's so widely used in the community isn't available in the default config pushes some of nix historic(?) governance issues right into their face, far too early in their journey into nix. Additionally, at this point in time any breaking changes to flakes could cause such widespread I am aware of at least some of the flaws in the current implementation, @getchoo provided a great list of links in their response for those interested in details. Remaining issues around fetchTree seem to be the biggest to me. The SCs role here would be to
|
Stabilization implies a long term promise that includes the stability of the hashes produced by Nix. This has wide ranging consequences that make it even harder to fix the numerous issues with Flakes. As a member of the Nix team I would consider supporting a statement that Flakes are ok to adopt, but with a carve-out for minor changes to such things as CLI flags and changes for the sustainable stabilization of I question the technical value of such a statement, but it could help inform users' decisions. If you want Flakes to stabilize sooner, and you don't mind getting into the nitty gritty of fetching, locking, or the CLI UX, please get in touch with the Nix team. ❤️ |
It's crucial to differentiate between the changes to the While I consider the For my own systems, I've used flakes for years (it's a decent-enough entrypoint to multi-system configs), and have even contributed As a functional programmer and Nix user, I am frustrated that the |
I think the law of "Good Enough" applies here. Flakes are a de-facto standard already, and them being marked as experimental causes additional friction. Flakes have many flaws, the posts pointed out by getchoo ("Flakes aren't real and cannot hurt you [...]" in particular) are all good discussions about what those flaws are. But despite that, they are overall quite stable, and I've been using them as the foundation of my NixOS configuration for years now. I think Lix has the best approach here: Both Flakes and non-Flakes are important and need to be maintained. Flakes needs to inherit some of the ease of usability that non-flakes has (A good recent example being the "unflake" template I recently added to my config, which makes a devshell using a |
Question
Today, at least me, suggest everyone coming to Nix to take a look on flakes, but everyone eventually has to deal with the showstopper to enable nix-command and flakes as an experimental feature.
The last nix-command breakage, at least the last one I noticed, was the one to update specific inputs that changed a little.
What are your thoughs about the road to remove these feature flags so it is enabled by default?
Candidates I'd like to get an answer from
No response
Reminder of the Q&A rules
Please adhere to the Q&A guidelines and rules
The text was updated successfully, but these errors were encountered: