about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tools/depotfmt.nix13
-rw-r--r--tvix/default.nix7
2 files changed, 10 insertions, 10 deletions
diff --git a/tools/depotfmt.nix b/tools/depotfmt.nix
index a1caab0e210e..e40001018c37 100644
--- a/tools/depotfmt.nix
+++ b/tools/depotfmt.nix
@@ -28,6 +28,7 @@ let
 
     [formatter.rust]
     command = "${pkgs.rustfmt}/bin/rustfmt"
+    options = ["--edition", "2021"]
     includes = [ "*.rs" ]
     excludes = [
       "users/tazjin/*",
@@ -53,10 +54,12 @@ let
   '';
 in
 depotfmt.overrideAttrs (_: {
-  passthru.config = config;
-  passthru.meta.ci.extraSteps.check = {
-    label = "depot formatting check";
-    command = check;
-    alwaysRun = true;
+  passthru = {
+    inherit config check;
+    meta.ci.extraSteps.check = {
+      label = "depot formatting check";
+      command = check;
+      alwaysRun = true;
+    };
   };
 })
diff --git a/tvix/default.nix b/tvix/default.nix
index f8aa47a108c5..0d833eb1e50a 100644
--- a/tvix/default.nix
+++ b/tvix/default.nix
@@ -73,11 +73,8 @@ in
         cargo metadata > /dev/null
 
         ${pkgs.crate2nix}/bin/crate2nix generate --all-features
-        ${pkgs.treefmt}/bin/treefmt Cargo.nix \
-          --no-cache \
-          --on-unmatched=debug \
-          --config-file=${depot.tools.depotfmt.config} \
-          --tree-root=.
+        # Reuse depotfmt wrapper that can be used inside a sandbox.
+        ${depot.tools.depotfmt.check} Cargo.nix
 
         # technically unnecessary, but provides more-helpful output in case of error
         diff -ur Cargo.nix ${src}/Cargo.nix