doc: don't recommend using emulator for completions (#406310)

This commit is contained in:
Winter 2025-05-14 15:27:01 -04:00 committed by GitHub
commit 885f83e2e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -99,17 +99,12 @@ failure. To prevent this, guard the completion generation commands.
```nix ```nix
{ {
nativeBuildInputs = [ installShellFiles ]; nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ( postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
let # using named fd
emulator = stdenv.hostPlatform.emulator buildPackages; installShellCompletion --cmd foobar \
in --bash <($out/bin/foobar --bash-completion) \
'' --fish <($out/bin/foobar --fish-completion) \
# using named fd --zsh <($out/bin/foobar --zsh-completion)
installShellCompletion --cmd foobar \ '';
--bash <(${emulator} $out/bin/foobar --bash-completion) \
--fish <(${emulator} $out/bin/foobar --fish-completion) \
--zsh <(${emulator} $out/bin/foobar --zsh-completion)
''
);
} }
``` ```