-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
gst_all_1: use newScope to create package set #110459
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
Conversation
| monado = callPackage ../applications/graphics/monado { | ||
| inherit (gst_all_1) gstreamer gst-plugins-base; | ||
| }; | ||
| monado = gst_all_1.callPackage ../applications/graphics/monado { }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should avoid this pattern in package sets: using the callPackage from a different scope breaks composition. In these cases it is in my opinion much better to pass in the subpackage set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related RFC NixOS/rfcs#83.
|
Alternately, we could move those packages to top-level. But scoping sound good to me too. cc @worldofpeace |
|
@jtojnar I think some time in the past came upon that the need for a |
|
I marked this as stale due to inactivity. → More info |
|
I think #131295 fixed this by removing final: prev: {
gst_all_1 = prev.gst_all_1 // {
gstreamer = prev.gst_all_1.gstreamer.overrideAttrs( prev: {
pname= prev.pname + "-foo";
});
};
}Checking |
Motivation for this change
Overriding
gst_all_1.gstreameris a pain, because it is contained in arecset and manually passes itself and other dependencies from the set directly to dependent packages. So in order to propagate a overwrittengstreamerto it's dependent packages an overlay like this is required:This overlay would also miss new packages in the set depending on any of the current packages.
Using
lib.makeScopewould allow to conveniently override any package in the set and ensure it is used in all dependent packages:Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)