about summary refs log tree commit diff
path: root/tvix
diff options
context:
space:
mode:
Diffstat (limited to 'tvix')
-rw-r--r--tvix/default.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/tvix/default.nix b/tvix/default.nix
index 43b942cef096..339a657efd5f 100644
--- a/tvix/default.nix
+++ b/tvix/default.nix
@@ -131,7 +131,31 @@ in
     '';
   };
 
+  # Run cargo clippy. We run it with -Dwarnings, so warnings cause a nonzero
+  # exit code.
+  clippy = pkgs.stdenv.mkDerivation {
+    inherit cargoDeps;
+    name = "tvix-clippy";
+    src = depot.third_party.gitignoreSource ./.;
+    PROTO_ROOT = depot.tvix.proto;
+
+    buildInputs = [
+      pkgs.fuse
+    ];
+    nativeBuildInputs = with pkgs; [
+      cargo
+      clippy
+      pkg-config
+      protobuf
+      rustc
+      rustPlatform.cargoSetupHook
+    ];
+
+    buildPhase = "cargo clippy -- -Dwarnings | tee $out";
+  };
+
   meta.ci.targets = [
+    "clippy"
     "shell"
     "rust-docs"
   ];