mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-23 16:32:23 +03:00
25 lines
527 B
Nix
25 lines
527 B
Nix
|
{ cargoBuild
|
||
|
, rustfmt
|
||
|
}:
|
||
|
|
||
|
{ cargoExtraArgs ? ""
|
||
|
, rustFmtExtraArgs ? ""
|
||
|
, ...
|
||
|
}@origArgs:
|
||
|
let
|
||
|
args = builtins.removeAttrs origArgs [ "rustFmtExtraArgs" ];
|
||
|
in
|
||
|
cargoBuild (args // {
|
||
|
cargoArtifacts = null;
|
||
|
cargoVendorDir = null;
|
||
|
doCheck = false;
|
||
|
doInstallCargoArtifacts = false;
|
||
|
doRemapSourcePathPrefix = false;
|
||
|
pnameSuffix = "-fmt";
|
||
|
|
||
|
cargoBuildCommand = "cargo fmt";
|
||
|
cargoExtraArgs = "${cargoExtraArgs} -- --check ${rustFmtExtraArgs}";
|
||
|
|
||
|
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ rustfmt ];
|
||
|
})
|