tvl-depot/tvix/store/default.nix
Florian Klink ceb2c0ba89 chore(tvix/store): make importable
This allows other crates to import tvix_store.

Rename the bin crate to tvix-store-bin, to avoid having multiple crates
with the same name (https://github.com/rust-lang/cargo/issues/6313)

Change-Id: I857768d6115640dbf102e79ed03e8474090df2fe
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7728
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
2023-01-03 13:03:07 +00:00

39 lines
948 B
Nix

{ depot, pkgs, ... }:
let
protoRoot = depot.nix.sparseTree depot.path.origSrc [
./protos/castore.proto
./protos/pathinfo.proto
./protos/rpc_blobstore.proto
./protos/rpc_directory.proto
./protos/rpc_pathinfo.proto
];
protobufDep = prev: (prev.nativeBuildInputs or [ ]) ++ [ pkgs.protobuf ];
in
depot.tvix.crates.workspaceMembers.tvix-store-bin.build.override {
# Ensure protobuf dependencies are available.
# TODO: figure out a way to embed this directly in the //tvix
# crate2nix config.
crateOverrides = {
prost-build = prev: {
nativeBuildInputs = protobufDep prev;
};
tonic-reflection = prev: {
nativeBuildInputs = protobufDep prev;
};
tvix-store = prev: {
PROTO_ROOT = protoRoot;
nativeBuildInputs = protobufDep prev;
};
tvix-store-bin = prev: {
PROTO_ROOT = protoRoot;
nativeBuildInputs = protobufDep prev;
};
};
runTests = true;
}