How to make Nixpkgs more eco-friendly / use less resources

I mentioned a potential solution to avoiding downstream rebuilds from (internal) library changes before: build against library stubs, then relink against the real thing in a second derivation. If one wanted to not only avoid rebuilds but also minimize substitution, the second derivation should be built locally (though allowSubstitutes = false may be a bit too strong for that). Then only libraries/executables that truly changed should be refetched, as long as the stubs are unaffected.

4 Likes