about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tvix/proto/castore.proto40
-rw-r--r--tvix/proto/default.nix1
2 files changed, 41 insertions, 0 deletions
diff --git a/tvix/proto/castore.proto b/tvix/proto/castore.proto
new file mode 100644
index 000000000000..14a689ea5ba2
--- /dev/null
+++ b/tvix/proto/castore.proto
@@ -0,0 +1,40 @@
+// SPDX-FileCopyrightText: edef <edef@unfathomable.blue>
+// SPDX-License-Identifier: OSL-3.0 OR MIT OR Apache-2.0
+
+syntax = "proto3";
+
+package fossil.store;
+
+message Directory {
+    repeated DirectoryNode directories = 1;
+    repeated FileNode files = 2;
+    repeated LinkNode links = 3;
+}
+
+message DirectoryNode {
+    string name = 1;
+    bytes ref = 2;
+    uint32 size = 3;
+}
+
+message FileNode {
+    string name = 1;
+    bytes ref = 2;
+    uint32 size = 3;
+    bool executable = 4;
+}
+
+message LinkNode {
+    string name = 1;
+    string target = 2;
+}
+
+message Blob {
+    bytes bao_inline = 3;
+    repeated Chunk chunks = 4;
+}
+
+message Chunk {
+    uint64 offset = 1;
+    uint32 length = 2;
+}
diff --git a/tvix/proto/default.nix b/tvix/proto/default.nix
index 35e2eba7fed4..26673cdf747f 100644
--- a/tvix/proto/default.nix
+++ b/tvix/proto/default.nix
@@ -5,5 +5,6 @@
 
 pkgs.runCommand "tvix-cc-proto" { } ''
   mkdir $out
+  ${pkgs.protobuf}/bin/protoc -I ${./.} castore.proto --cpp_out=$out
   ${pkgs.protobuf}/bin/protoc -I ${./.} evaluator.proto --cpp_out=$out
 ''