Merge pull request #13 from basvandijk/do-not-copyDocsToSeparateOutput-for-deps

Don't copy the docs to a separate doc output for the dependencies
This commit is contained in:
Bas van Dijk 2019-08-26 16:40:21 +02:00 committed by GitHub
commit 5b148cf5ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -7,6 +7,7 @@ src:
, copyBuildArtifacts ? false
, doCheck ? true
, doDoc ? true
, copyDocsToSeparateOutput ? true
#| Whether to remove references to source code from the generated cargo docs
# to reduce Nix closure size. By default cargo doc includes snippets like the
# following in the generated highlighted source code in files like: src/rand/lib.rs.html:
@ -79,7 +80,7 @@ with rec
};
};
outputs = [ "out" ] ++ lib.optional doDoc "doc";
outputs = [ "out" ] ++ lib.optional (doDoc && copyDocsToSeparateOutput) "doc";
preInstallPhases = lib.optional doDoc [ "docPhase" ];
CARGO_BUILD_PROFILE = if release then "release" else "debug";
@ -246,7 +247,7 @@ with rec
cp -r target $out
''}
${lib.optionalString doDoc ''
${lib.optionalString (doDoc && copyDocsToSeparateOutput) ''
cp -r target/doc $doc
''}

View file

@ -162,6 +162,7 @@ with rec
{ cargoBuild = "source ${buildDepsScript}";
doCheck = false;
copyBuildArtifacts = true;
copyDocsToSeparateOutput = false;
cargolock = cargolock';
cargotoml =
{ package = { name = "dummy"; version = "0.0.0"; }; } //