POC of overlays approach to customization #137
Closed
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.
This is a draft implementation of the idea I put forward in #134.
Using this I was able to successfully:
nixpkgs
sources.json
and unsetNIX_PATH
nixpkgs = ...
type: "tarball"
continued to work.__fetchers = super.__fetchers // { fetchgit = (import self.nixpkgs {}).fetchgit; };
type: "fetchgit"
worked as expected.Ideally I'd add tests for these usecases but I'm too lazy to do it for the POC.
Downsides:
sources.nix
changes.nixpkgs
entry in sources is less special, so needs to be imported withbuiltin-tarball
so that the "bootstrapping" works. Arguably this is an upside!fetchgit
example to work: this is solved in newer nixpkgs, and we can probably get rid of the arguments for thefetchzip
andfetchurl
calls too.makeOverridable
didn't preserve function arguments, now it does. In 19.09 but not 19.03.)I think the downsides are all fine with a tiny bit of documentation, since this is advanced usage anyway.