mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-23 08:22:41 +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 ];
|
|
})
|