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

19 lines
345 B
Nix

{ mkCargoDerivation
}:
{ cargoDocExtraArgs ? "--no-deps"
, cargoExtraArgs ? ""
, ...
}@origArgs:
let
args = (builtins.removeAttrs origArgs [
"cargoDocExtraArgs"
"cargoExtraArgs"
]);
in
mkCargoDerivation (args // {
pnameSuffix = "-doc";
buildPhaseCargoCommand = "cargoWithProfile doc ${cargoExtraArgs} ${cargoDocExtraArgs}";
})