Is your feature request related to a problem? Please describe.
Not necessarily, since nix-build-uncached exists, but it seems like a nice-to-have in nix itself. Also, I think the implementation in nix itself would likely be much more simple than nix-build-uncached itself, just due to how it works.
Describe the solution you'd like
nix build --lacking-substitutes .#packages would build only the packages which can not be substituted from a known store or trusted binary cache.
Also, a more-eloquent flag name would work, but I can't think of any :).
Describe alternatives you've considered
Just using nix-build-uncached.
Additional context
This makes using Nix in CI scenarios a bit easier. For example, nixpkgs-wayland cuts down on wasted resources significantly by using nix-build-uncached. Otherwise the builder will download hundreds of MBs of store paths just to fulfill the build, even though in reality we only want to build binary artifacts that aren't already in our CI's binary cache.
Alternatively
It seems like nix-build-uncached has to resolve unsubstitutable-derivations by parsing the output of nix-build supposedly because nix build's dry-run doesn't work; maybe that could be fixed.
cc: @Mic92
Is your feature request related to a problem? Please describe.
Not necessarily, since
nix-build-uncachedexists, but it seems like a nice-to-have innixitself. Also, I think the implementation innixitself would likely be much more simple thannix-build-uncacheditself, just due to how it works.Describe the solution you'd like
nix build --lacking-substitutes .#packageswould build only the packages which can not be substituted from a known store or trusted binary cache.Also, a more-eloquent flag name would work, but I can't think of any :).
Describe alternatives you've considered
Just using
nix-build-uncached.Additional context
This makes using Nix in CI scenarios a bit easier. For example,
nixpkgs-waylandcuts down on wasted resources significantly by usingnix-build-uncached. Otherwise the builder will download hundreds of MBs of store paths just to fulfill the build, even though in reality we only want to build binary artifacts that aren't already in our CI's binary cache.Alternatively
It seems like
nix-build-uncachedhas to resolve unsubstitutable-derivations by parsing the output ofnix-buildsupposedly becausenix build's dry-run doesn't work; maybe that could be fixed.cc: @Mic92