mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-25 21:42:20 +03:00
96fd12c710
--------- Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
25 lines
537 B
Nix
25 lines
537 B
Nix
{ taplo
|
|
, mkCargoDerivation
|
|
}:
|
|
|
|
{ taploExtraArgs ? ""
|
|
, ...
|
|
}@origArgs:
|
|
let
|
|
args = builtins.removeAttrs origArgs [ "taploExtraArgs" ];
|
|
in
|
|
mkCargoDerivation (args // {
|
|
cargoArtifacts = null;
|
|
cargoVendorDir = null;
|
|
pnameSuffix = "-tomlfmt";
|
|
|
|
buildPhaseCargoCommand = "taplo fmt --check ${taploExtraArgs}";
|
|
|
|
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ taplo ];
|
|
|
|
preInstallPhases = [ "ensureTargetDir" ] ++ (args.preInstallPhases or [ ]);
|
|
ensureTargetDir = ''
|
|
mkdir -p ''${CARGO_TARGET_DIR:-target}
|
|
'';
|
|
})
|