gst_all_1: use newScope to create package set#110459
gst_all_1: use newScope to create package set#110459B4dM4n wants to merge 2 commits intoNixOS:masterfrom
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.
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.
|
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)