tvl-depot/tools/crate2nix-generate.nix
Florian Klink 4497ac41ab refactor(tools): move crate2nix generate here
Having something running the depot crate2nix and formatting it with
depotfmt is useful outside of tvix too.

Change-Id: Iecc8f207da38cc6995747c5ea48d3911433fd416
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10658
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
2024-01-18 15:02:15 +00:00

8 lines
289 B
Nix

{ 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
''