about summary refs log tree commit diff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/crate2nix-generate.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/crate2nix-generate.nix b/tools/crate2nix-generate.nix
new file mode 100644
index 000000000000..a627588ae34b
--- /dev/null
+++ b/tools/crate2nix-generate.nix
@@ -0,0 +1,8 @@
+{ pkgs, depot, ... }:
+
+# Run crate2nix generate in the current working directory, then
+# format the generated file with depotfmt.
+pkgs.writeShellScriptBin "crate2nix-generate" ''
+  ${pkgs.crate2nix}/bin/crate2nix generate --all-features
+  ${depot.tools.depotfmt}/bin/depotfmt Cargo.nix
+''