crane/lib/cargoTarpaulin.nix
2022-10-23 23:20:22 +00:00

22 lines
501 B
Nix

{ mkCargoDerivation
, cargo-tarpaulin
}:
{ cargoExtraArgs ? ""
, cargoTarpaulinExtraArgs ? "--skip-clean --out Xml --output-dir $out"
, ...
}@origArgs:
let
args = builtins.removeAttrs origArgs [
"cargoExtraArgs"
"cargoTarpaulinExtraArgs"
];
in
mkCargoDerivation (args // {
buildPhaseCargoCommand = "cargoWithProfile tarpaulin ${cargoExtraArgs} ${cargoTarpaulinExtraArgs}";
pnameSuffix = "-tarpaulin";
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ cargo-tarpaulin ];
})