Skip to content
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.customisation: add makeOverridableGeneric #288431

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

9999years
Copy link
Contributor

This is my sketch of a "generic" lib.makeOverridable function. It doesn't work yet, but the idea is this could replace functions like haskell.lib.overrideCabal, overridePythonAttrs, overrideRust, and so on.

@infinisil
Copy link
Member

This sounds similar to #234651

@ShamrockLee
Copy link
Contributor

ShamrockLee commented Feb 28, 2024

Sounds like a good idea.

I personally hope that one day there won't be any custom overriders -- everything is passed properly to stdenv.mkDerivataion (either directly or under passthru), and we can override every attributes with <pkg>.overrideAttrs. However, as we currently still have/need custom overriders, it would be great to define them in a unified manner.

This sounds similar to #234651

They are both utilities to help build helper definition, but serve different purposes. Nevertheless, they both reflect the imperfect status quo where build helpers still have a lot of arguments that cannot be passed into stdenv.mkDerivation.

{
name,
inner,
wrap ? [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this argument enables wrapping existing overriders such as overrideAttrs and override? If so, how about giving it some sensible default elements`?

Suggested change
wrap ? [],
wrap ? [ "override" "overrideAttrs" "overrideDerivation" ],

@wegank wegank added 2.status: merge conflict This PR has merge conflicts with the target branch 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md labels Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: lib The Nixpkgs function library 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants