diff --git a/nixpkgs/nixpkgs.bzl b/nixpkgs/nixpkgs.bzl index 061170e6..a96edd91 100644 --- a/nixpkgs/nixpkgs.bzl +++ b/nixpkgs/nixpkgs.bzl @@ -1054,7 +1054,9 @@ _nixpkgs_python_toolchain = repository_rule( def _python_nix_file_content(attribute_path, bin_path, version): if versions.is_at_least("4.2.0", versions.get()): - stub_shebang = """stub_shebang = "#!${{{attribute_path}}}/{bin_path}",""".format( + # Include bash path to the shebang to avoid problems on macOS + # see https://github.com/NixOS/nixpkgs/pull/93757 + stub_shebang = """stub_shebang = "#!${{({attribute_path}).stdenv.shell}} ${{{attribute_path}}}/{bin_path}",""".format( attribute_path = attribute_path, bin_path = bin_path, )