-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
gst_all_1: use newScope to create package set #110459
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.gstreamer
is a pain, because it is contained in arec
set and manually passes itself and other dependencies from the set directly to dependent packages. So in order to propagate a overwrittengstreamer
to 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.makeScope
would allow to conveniently override any package in the set and ensure it is used in all dependent packages:Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)