crane/lib/cargoDoc.nix

20 lines
362 B
Nix

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