Commit graph

4 commits

Author SHA1 Message Date
Vincent Ambo
159646787a feat(nix/lazy-deps): add override pattern for deps
Introduces a `.overrideDeps` attribute with which additional tools can
be supplied. This works like `.override` in nixpkgs.

Change-Id: I69a009b51f7f073a2d030eda5e3b5310e0f8e883
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8491
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
2023-04-24 10:56:40 +00:00
zimbatm
66a8ce5900 feat(nix/lazy-deps): add passthru.devShell
Allows to easily convert a lazy-deps into a nix-shell compatible
derivation.

Change-Id: I65a0609642f12e0d00658c69cc394a73dddccd16
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5855
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
2022-12-26 10:31:34 +00:00
zimbatm
99030d10ce refactor(nix/lazy-deps): use runCommand
writeTextFile is nice, but not flexible enough to allow the passthru
argument needed for a follow-up change.

Change-Id: I4f0cffd0f29b2c06b0155101d3806c9c5745c37a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5854
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
2022-12-26 10:31:34 +00:00
Vincent Ambo
0ce396bdab feat(nix/lazy-deps): Add function to generate lazy binary dispatcher
There is a reoccuring problem in readTree-type repositories that use
nix-shell, where evaluation of the full set of dependencies that
should be made available to users takes a noticeable amount of time,
slowing down operations when `direnv` is involved.

In depot, we have so far fixed this by maintaining a manual `//bin`
directory which contains a set of symlinks to a central dispatch
script that can dispatch to various tools in depot lazily.

This script can instead be generated ad-hoc by Nix (pretty fast if we
can make assumptions like `git` and `nix-build` existing on user's
machines already) and added to $PATH.

The function introduced in this commit implements the logic for that.
The structure of the script is based on the existing
`//bin/__dispatch`.

This does not yet switch depot's envrc to use this new method of
installing dependencies lazily.

Change-Id: I92efcd9bb6aa51aa2709ad910a464e9dac97ee89
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5512
Tested-by: BuildkiteCI
Reviewed-by: ezemtsov <eugene.zemtsov@gmail.com>
2022-05-02 23:34:55 +00:00