about summary refs log tree commit diff
path: root/tvix/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/default.nix')
-rw-r--r--tvix/default.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/tvix/default.nix b/tvix/default.nix
index 23ce0592ceb6..8708222a603d 100644
--- a/tvix/default.nix
+++ b/tvix/default.nix
@@ -1,5 +1,5 @@
 # Nix helpers for projects under //tvix
-{ pkgs, ... }:
+{ pkgs, depot, ... }:
 
 {
   # Load the crate2nix crate tree.
@@ -8,6 +8,13 @@
     nixpkgs = pkgs.path;
   };
 
+  # Run crate2nix generate in the current working directory, then
+  # format the generated file with depotfmt.
+  crate2nixGenerate = pkgs.writeShellScriptBin "crate2nix-generate" ''
+    ${pkgs.crate2nix}/bin/crate2nix generate
+    ${depot.tools.depotfmt}/bin/depotfmt Cargo.nix
+  '';
+
   # Provide a shell for the combined dependencies of all Tvix Rust
   # projects. Note that as this is manually maintained it may be
   # lacking something, but it is required for some people's workflows.