buildLazyBinaries: init build support helper #71951
Closed
+80
−0
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 helps create shell binaries, which build their corresponding
packages, only when run.
By default, it uses package names identical to command
names. Binaries, contained by packages with different name, can be
listed in a catalog.
Motivation for this change
I often want to update my system, but I also want to have access to many packages on my system path. This creates a tension: installing many packages means lots of download volume and / or build time (especially if you're on master).
Considering the pervasive laziness of nix, wouldn't it be nice, if there was a sort of lazy nix-shell, that would build packages only at the last second, before calling into binaries from them?
Things done
This is a proof of concept, mainly for personal use and to gauge interest.
It might already be a workable prototype, please have a look at the code comments, to get a sense of the direction, I can see this going.
I'm open to suggestions for the interface, especially on collision-detection/prioritization/runtime-dispatch and renames.
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
not sure who to cc this to, in particular. I need feedback about having the catalog built on hydra and other integrations. I think, right now, this should already be of interest to everybody doing nixos development, but a nixos module for it could also benefit infrequent users of heavy packages, replacing
nix-shell -p
.