-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
Reorg Nixpkgs --- rip off bandaid approach #172008
Comments
I have more questions than answers. Here we go :)
We'll want to help with this in some way. Also there's real information in the glue, that we can't ignore.
The current pattern is to write an abstract package function somewhere in I suppose this information can be made first class as a function from something like How will packaging functions like
This seems like a good idea because incremental changes would be too numerous and disorganized. For this change to be viable, we need a plan. I'd suggest experimenting in a fork, adding to Nixpkgs only, so that it can be merged without breaking continuity for users and maintainers. Packages can migrate individually. The two solutions should coexist in the same monorepo to make the migration feasible; incrementality not by making small changes, but by interoperability during the migration. The risk is that the migration gets stuck because the new solution isn't good enough, so that's why we need to validate the new solution in a fork first.
The new If it doesn't have overriding, we don't need
I kid you not.
😭 Some tangential(?) questions
|
Wrote NixOS/nix#6507 to discuss the definition of "package" as the interface between Nix itself and expressions. It needs to be far, far more conservative for compatibility reasons of course and I think these should be largely distinct conversations, but the connection is present. |
That's one of the main selling points of nix/nixpkgs. |
It is important to me too. Overriding, as it exists, is inconsistent and a bit buggy at times because of the complexity of implementing it correctly while trying to work around the fact that multiple levels of overriding don't compose well.
Let me add that reverting to the status quo is a perfectly acceptable outcome at any point before deprecation. |
I think those are both excellent points, but it is useful to separate the steps causing mass rebuilds (those) from things that are more purely nix expr orgnaization and so should not. |
An important thing to consider is improving how e.g. python packaging works, because it is really hard to "just" add a new python package in an overlay, because it must be overridden for each python version, instead of having e.g. a python fixpoint extender, like: final: prev: {
python-all-pkgs = python-fix: python-interp: (prev.pyrthon-all-pkgs python-fix python-interp) // {
my-awesome-package = python-interp.mkPythonModule /* etc */;
};
} |
I completely agree. More and more power has been added to make manipulation of the post-callPackage'd derivation and package sets convenient, but it has drawbacks that make large-scale composition difficult. I've been calling the function that can be callPackage'd a "proto-derivation" - the thing that can produce a derivation. I've been using this as the base unit of composition, as opposed to override/overlay approaches. This tends to produce easier to understand behavior and easier composition. The outcome can still use overrides, but that becomes far less common. Re-use is as easy as Using scopes allows nice unification of various package sets enabling this to work:
|
@tomberek Looks nice. Some questions.
Doesn't seem like a bad idea to start listing requirements. I'll make a start. Must have:
Nice to have (maybe):
|
The Nixpkgs Architecture Team has now been formed to discuss and develop ideas like this. |
Issue description
Nixpkgs' architecture is not the best. Issues:
Potential solution
callPackage
on their own.passthru
.override
.overrideAttrs
.extend
or similar. If you want something different, you need to rebuild the fixed point manually.This is a radical shift that would make many "minor" overrides quite a bit more annoying, in addition to other breakage. But I think it would also put us on a much firmer, more sustainable foundation. Any idea how we get there incrementally?
The text was updated successfully, but these errors were encountered: