In the deps derivation the docs are already contained in `target`
which is copied to `$out`. So in that case also copying the docs to a
separate `$doc` output wastes space. Only the final derivation should
have its docs in a separate `$doc` output.
Apparently the cargolock env var can become too big so we replace it
with a file. This fixes the following error:
building
'/nix/store/s8bv90acizsyvh1s9gk7yvpiyw2gcpnx-dfinity-application-and-others-deps.drv'...
while setting up the build environment: executing
'/nix/store/cinw572b38aln37glr0zb8lxwrgaffl4-bash-4.4-p23/bin/bash':
Argument list too long
See the following on the background of why env vars can become too big:
https://stackoverflow.com/questions/28865473/setting-environment-variable-to-a-large-value-argument-list-too-long