about summary refs log tree commit diff
path: root/tvix/store-go/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/store-go/default.nix')
-rw-r--r--tvix/store-go/default.nix25
1 files changed, 25 insertions, 0 deletions
diff --git a/tvix/store-go/default.nix b/tvix/store-go/default.nix
new file mode 100644
index 000000000000..b559594a27f2
--- /dev/null
+++ b/tvix/store-go/default.nix
@@ -0,0 +1,25 @@
+{ depot, pkgs, ... }:
+
+(pkgs.buildGoModule {
+  name = "store-go";
+  src = depot.third_party.gitignoreSource ./.;
+  vendorHash = "sha256-WAYaIT3h3Cdvo1RB8T7DuoxeKvXfkq8vo/vdkhJQDs0=";
+}).overrideAttrs (_: {
+  meta.ci.extraSteps = {
+    check = {
+      label = ":water_buffalo: ensure generated protobuf files match";
+      needsOutput = true;
+      command = pkgs.writeShellScript "pb-go-check" ''
+        ${depot.tvix.store-go-generate}
+        if [[ -n "$(git status --porcelain -unormal)" ]]; then
+            echo "-----------------------------"
+            echo ".pb.go files need to be updated, run //tvix:store-go-generate"
+            echo "-----------------------------"
+            git status -unormal
+            exit 1
+        fi
+      '';
+      alwaysRun = true;
+    };
+  };
+})