buildYarnPackage: Add support for packageOverrides #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Disclaimer: The branch is mainly for me to have a somewhat "stable" Flake URL, feel free to close this pull request if it's not wanted or if the way I've done it doesn't suit your or the project's goals.
This is similar to b5cd694, which added the attribute to
mkNodeModule
andbuildNpmPackage
but didn't do it for thebuildYarnPackage
flavour.However, we're using lib.extends instead of a plain attribute set, since we want to tread the original package set as a fixed point to be composable with multiple levels of overrides, similar to how it's done with nixpkgs overlays.
In my case it's to quickly override a dependency fetched from GitHub, eg. like this:
I know that the way I've done the above is probably winning the first price for "the ugliest override" but since I'm not particularly invested in anything related to node.js, I'm usually pretty cruel when it comes to it.
So the above example is just to have a complete almost-real-world example for reference and in this case it's to work around #7.