about summary refs log tree commit diff
path: root/tvix/store/default.nix
blob: 65289cacc87cd5d4b139300a2fd451e627567faa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ 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;
}