-
-
Notifications
You must be signed in to change notification settings - Fork 17.7k
lib.makeOverridable: propagate .override #441853
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
lib.makeOverridable: propagate .override #441853
Conversation
This is now done by lib.makeOverridable already.
infinite recursion in gobject-introspection/wrapper.nix... have yet to figure that out.
|
I am not sure I have a super clear opinion on whether this is a good thing or not. I dislike I do think that not being able to express this kind of thing nicely is a wart of I wonder about the perf impact. |
I do as well, but I would have to fix a lot more stuff before I can get a report :/ |
The thing is.. that I do dislike the confusion of flags and dependencies as well - and with |
I suspect not: most packages aren’t generic builders made to build arbitrary things vaguely related to the thing they’re packaging. Rather, the cases where something so low‐level would be needed needed are precisely the cases where the choice between a multi‐version package, a generic builder function, and a vendored derivation should be made. |
|
Well yes, but how do you integrate a multi-version package with a builder function into by-name? I see these options:
Even if you use the builder function, it will end up the same - you need to deal with two |
With the same idea used in #442066, we could probably also make overrides "first class", something like: {
type = "override";
package = "foo";
override = self: old: {
bar = old.bar.override { foobar = self.foobar_1_0; };
};
}This would then not go through |
Just a draft to resolve #441492 (comment):
With this PR, you can do:
where:
channel = stableis passed to https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/_1/_1password-gui-beta/package.nixlibis only passed to https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/_1/_1password-gui/package.nix, but not./linux.nix- otherwise it would error because stuff in lib is failing.polkitPolicyOwnersis passed to https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/_1/_1password-gui/linux.nixThe idea is that outer
.overrides "consume" arguments and pass on what is left.In theory, this should not be a breaking change, because arguments that the outer function can't consume would currently throw an error. Unless... people are using
... }@argsstuff. I hit some of that in https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/gobject-introspection/wrapper.nix#L27-L33 - and just temporarily worked around that for now.I'd like to discuss the idea first - is this something that we want to have? Is this something that we can actually do given the breaking change potential for this specific
@argsuse-case?Even if we have breaking changes.. we surely have a lot more packages just flat out doing it wrong, which we would fix that way.
_1password-guiis just the first thing that I hit, I'm sure.WDYT @emilazy?
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.