diff --git a/pkgs/by-name/ed/edk2-uefi-shell/package.nix b/pkgs/by-name/ed/edk2-uefi-shell/package.nix index 8853243cc597..47ad2e5196b2 100644 --- a/pkgs/by-name/ed/edk2-uefi-shell/package.nix +++ b/pkgs/by-name/ed/edk2-uefi-shell/package.nix @@ -23,16 +23,17 @@ edk2.mkDerivation "ShellPkg/ShellPkg.dsc" (finalAttrs: { ]; strictDeps = true; - env.NIX_CFLAGS_COMPILE = toString ( - lib.optionals stdenv.cc.isClang [ + env = { + # Set explicitly to use Python 3 from nixpkgs. Otherwise, the build system will detect and try to + # use `/usr/bin/python3` on Darwin when sandboxing is disabled. + PYTHON_COMMAND = "${lib.getBin pkgsBuildHost.python3}/bin/python3"; + } + // lib.optionalAttrs stdenv.cc.isClang { + NIX_CFLAGS_COMPILE = toString [ "-fno-pic" "-Qunused-arguments" - ] - ); - - # Set explicitly to use Python 3 from nixpkgs. Otherwise, the build system will detect and try to - # use `/usr/bin/python3` on Darwin when sandboxing is disabled. - PYTHON_COMMAND = "${lib.getBin pkgsBuildHost.python3}/bin/python3"; + ]; + }; # We only have a .efi file in $out which shouldn't be patched or stripped dontPatchELF = true;