From 2cf25e711ce4721cdac41ac20d8d153bc3af6acc Mon Sep 17 00:00:00 2001 From: awwpotato Date: Sun, 11 May 2025 18:46:54 -0700 Subject: [PATCH] Revert "installShellFiles: add emulator doc for installShellCompletion" This reverts commit 149a6e0a917d7704ba58614eda817f39e8245e7a. See discussion in https://github.com/NixOS/nixpkgs/issues/308283 for more details on why this isn't something we want to suggest. --- doc/hooks/installShellFiles.section.md | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/doc/hooks/installShellFiles.section.md b/doc/hooks/installShellFiles.section.md index f33545477c6d..edaea5895a3b 100644 --- a/doc/hooks/installShellFiles.section.md +++ b/doc/hooks/installShellFiles.section.md @@ -99,17 +99,12 @@ failure. To prevent this, guard the completion generation commands. ```nix { nativeBuildInputs = [ installShellFiles ]; - postInstall = lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ( - let - emulator = stdenv.hostPlatform.emulator buildPackages; - in - '' - # using named fd - installShellCompletion --cmd foobar \ - --bash <(${emulator} $out/bin/foobar --bash-completion) \ - --fish <(${emulator} $out/bin/foobar --fish-completion) \ - --zsh <(${emulator} $out/bin/foobar --zsh-completion) - '' - ); + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + # using named fd + installShellCompletion --cmd foobar \ + --bash <($out/bin/foobar --bash-completion) \ + --fish <($out/bin/foobar --fish-completion) \ + --zsh <($out/bin/foobar --zsh-completion) + ''; } ```