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)
This commit is contained in:
Mix
2026-07-11 17:29:35 +08:00
parent ebdb19cd46
commit 883e799eb2
+14 -2
View File
@@ -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/