This focuses on Rust packages, since the most commonly used argument
parser library (clap/structopt) makes the following pattern natural and
thus common:
postInstall = ''
installShellCompletion --cmd foo \
--bash <($out/bin/foo completion bash) \
…
This commit just guards those with
lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform)
splitting the string where unrelated actions are performed.
I added `asciidoctor` to the nativeBuildInputs as I saw warnings that it
wasn't found as I built the tool.
I also stopped using `rec` syntax as the nixpkgs manual recommends
[against it](https://nixos.org/manual/nixpkgs/unstable/#mkderivation-recursive-attributes).
However, `rustPlatform.buildRustPackage` doesn't allow the use of
`mkDerivation (finalAttrs: {` form, so it's just a simple `let` binding
here.