From 883e799eb2843d1438a5ce76ed8ac4a924cf6ce5 Mon Sep 17 00:00:00 2001 From: Mix <32300164+mnixry@users.noreply.github.com> Date: Sat, 11 Jul 2026 01:21:05 +0800 Subject: [PATCH] starship: fix build on Darwin Work around the Darwin ld64 libc++ hardening issue by linking starship with LLVM lld on Darwin. This follows the temporary mitigation pattern used by other affected Darwin packages while NixOS/nixpkgs#536365 is pending. This keeps the default notify feature enabled; only the Darwin linker is changed. Assisted-by: OpenAI Codex (GPT-5.5) --- pkgs/by-name/st/starship/package.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/st/starship/package.nix b/pkgs/by-name/st/starship/package.nix index 877f887a9569..d5482bf24114 100644 --- a/pkgs/by-name/st/starship/package.nix +++ b/pkgs/by-name/st/starship/package.nix @@ -3,6 +3,7 @@ stdenv, fetchFromGitHub, rustPlatform, + llvmPackages, installShellFiles, writableTmpDirAsHomeHook, gitMinimal, @@ -22,13 +23,24 @@ rustPlatform.buildRustPackage (finalAttrs: { hash = "sha256-pStNE8SMMVavL3ld6RO+5QQRJPXpqlU3asccS2tUoMQ="; }; - nativeBuildInputs = [ installShellFiles ]; + nativeBuildInputs = [ + installShellFiles + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.lld ]; buildInputs = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ writableTmpDirAsHomeHook ]; - env.TZDIR = "${tzdata}/share/zoneinfo"; + env = { + TZDIR = "${tzdata}/share/zoneinfo"; + } + // lib.optionalAttrs stdenv.hostPlatform.isDarwin { + # Work around ld64's libc++ hardening issue. + # + # TODO: Remove once #536365 reaches this branch. + NIX_CFLAGS_LINK = "-fuse-ld=lld"; + }; postInstall = '' presetdir=$out/share/starship/presets/