-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implicit attribute defaults/overrides inside package definition #273534
Comments
The first issue has another point - github won't even index the file for searching. Though it should be massively improved with the move to |
Yeah this problem has been discussed with the Nixpkgs Architecture Team throughout RFC 140. I don't have any concrete proposals nor the resources to come up with one for now, but if anybody else does, it would be great to synchronise with the NAT for that. |
dream2nix |
Analogy to multi-platform packagesThis has close parallels with how we handle platforms. We don't have separate toplevel We should do the same thing with versions. Each top level attribute should be not a single package (which hasn't been true since Version overrides then become straightforward: you simply delete from the Proof of ConceptI have a prototype here but it's nowhere near PR-ready. I developed it against
Notice how there is a reference cycle Highlight commits in the PoC
The main thing that's missing is that StatusI have a bunch of other nix-related projects that are close to the finish line so unfortunately I am not going to be able to finish this in the next month or two. If anybody wants to steal this idea and run with it more power to them; otherwise I'll come back to it in the spring. Footnotes
|
We really ought to have a place for abstract package information that isn't specific to a build of a package, or we'll keep incurring the performance and complexity cost of unused package evaluations / unnecessary overrides. For instance, evaluating All that said, I'm glad to see some experimentation happen in this area. #217243 was meant to mitigate some of this, but nitpick: @amjoseph-nixpkgs It is my understanding that the convention around |
With lazy attribute sets this could be improved. I'd like to pick up that PR again, cases where it seems useful frequently appear. |
I don't think we should invent language features to patch architectural flaws; the lack of a package concept that's not instantiated. I know it may have other uses, but this one basically doesn't count. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/why-is-there-only-one-version-in-nixpkgs/47773/3 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
Issue description
Currently, in order to override a package's arguments in order to i.e. pin a version of a library, you must do so at the
callPackage
location, usuallyall-packages.nix
. This has a few issues:callPackage
the by-name path in all-packages (officially documented)I've been a fan of explicit requirements; i.e. depending on
ffmpeg_5
rather thanffmpeg
with anffmpeg = ffmpeg_5;
override in all-packages. This also has issues, the primary one being that overrides aren't stable anymore and are even less intuitive as you'd have to override i.e.ffmpeg_5 = ffmpeg_6;
.IMHO, the benefits outweighed the downsides as overrides aren't really a stable thing to begin with but I'd prefer to fix this issue "proper". In order to do that we must either put the package definition into all-packages (yeah, no) or put the overrides into package definitions.
This issue exists as a collection point for ideas on how to realise this.
Related discussion: #204303
The text was updated successfully, but these errors were encountered: