pkgs.extend for adding overlays#47430
Conversation
|
@Ericson2314 you added a comment in the code that indicates |
|
Would like to merge this in a few days. cc @nbp |
nbp
left a comment
There was a problem hiding this comment.
This patch sounds good!
Please provide Nixpkgs documentation.
|
By Nixpkgs documentation, I mean the documentation which appears on https://nixos.org/ . |
3adfc45 to
6ac1ed1
Compare
This is something that I have found useful in tests. In practice I recommend that people call Nixpkgs once for performance and simplicity. The inline documentation mentions this too.
nbp
left a comment
There was a problem hiding this comment.
Thanks, for the Nixpkgs documentation, however I think some paragraph should be simplified and reordered as described below.
doc/functions/overrides.xml
Outdated
There was a problem hiding this comment.
This paragraph is not cristal clear to me when I read it. I think you meant something along the lines of: "These functions are used to make changes to a single package, while overlays can combine these changes across the entire set of packages of Nixpkgs"
Also, consider adding a link to the overlay section within the documentation.
There was a problem hiding this comment.
Thanks, I have improved the writing and added a link.
doc/overlays.xml
Outdated
There was a problem hiding this comment.
nit: I think this deserve its own listitem, instead of being a note on one way to install overlays.
There was a problem hiding this comment.
A listitem didn't work, because the list was about the way nixpkgs looks up its overlays, so I have shuffled some things around to make it fit.
6ac1ed1 to
3c2ae18
Compare
|
Can we do like stage-fixpoint // {
extend = ...;
appendOverlays = ...;
}so packages in nixpkgs cannot refer to this? |
|
Only other concern is for cross compilation, this cannot be used to change build tools, but maybe that's a feature not a bug :). Also, sorry for taking so long to review to this. |
|
@Ericson2314 no problem, thanks for reviewing :)
I recognize your concern about this feature. However, doing this would make Besides, if If it really is a problem, I suggest disabling it for Hydra only. You can use However, I do not recommend disabling it.
Then isn't that a general characteristic of overlays? |
|
@roberth well argued. Then instead, could you take a look at the config thing used by ofborg that makes nixpkgs tested without aliases, and try to immitate it here so ofborg can be made to do the same for extend? |
|
@Ericson2314 I've made a PR to ofborg. Does this satisfy your request? |
Motivation for this change
This is something that I have found useful in a test.
For example, you have one
pkgsat your disposal and you want to make sure that it gets passed around correctly by some code. So you add an overlay and run the thing in a way that depends on the extra overlay. Now you know it gets passed around properly.In practice I recommend that people call Nixpkgs once for performance and
simplicity. The inline documentation mentions this too.
That doesn't mean that
pkgs.extendshouldn't be an option for those who need it.Things done
sandboxinnix.confon non-NixOS)nix-shell -p nox --run "nox-review wip"./result/bin/)nix path-info -Sbefore and after)