feat(tvix): add crate2nixGenerate target
`mg run //tvix:crate2nixGenerate --` runs crate2nix generate and depotfmt's it afterwards. This removes a frequent point of friction, because the Cargo.nix emitted by crate2nix needs another formatter. Change-Id: I649495980718cd3847d4cff77c9d4bfcb599387c Reviewed-on: https://cl.tvl.fyi/c/depot/+/7612 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
parent
2e04f68df8
commit
40a17acdc1
2 changed files with 11 additions and 9 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue