diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a8e4e17ac52e..3a9b3bc2c7ac 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -971,7 +971,8 @@ with pkgs; makeShellWrapper = makeSetupHook { deps = [ dieHook ]; substitutions = { - shell = targetPackages.runtimeShell; + # targetPackages.runtimeShell only exists when pkgs == targetPackages (when targetPackages is not __raw) + shell = if targetPackages ? runtimeShell then targetPackages.runtimeShell else throw "makeWrapper/makeShellWrapper must be in nativeBuildInputs"; }; passthru = { tests = tests.makeWrapper;