feat(tvix/store/bin): add "copy" command

This allows copying individual store paths from the local /nix/store
into tvix-store.

As we don't support getting this information from Nix yet, we currently
expect metadata to be provided externally:

Nix' `exportReferencesGraph` feature contains pretty much all data we
need for this. Expect a list of this information at a well-known key
(`closure`, similar to nixpkgs' `pkgs/build-support/binary-cache/
default.nix`).

We currently simply upload all store paths sequentially, without any
parallelism or awareness in how the reference graph looks like.

As long as the connected stores don't enforce this, this is fine, at
least for now.

Change-Id: Ib83c998465adddfdb110db994843c44e26b3d3d8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11397
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
This commit is contained in:
Florian Klink 2024-04-12 19:23:25 +03:00 committed by clbot
parent 863c4207cc
commit a4f65ddba0
4 changed files with 99 additions and 0 deletions

1
tvix/Cargo.lock generated
View file

@ -4528,6 +4528,7 @@ dependencies = [
"rstest",
"rstest_reuse",
"serde",
"serde_json",
"serde_qs",
"serde_with",
"sha2",