From f93cef19e8c20f24cd5aff2617ac99917b489ea6 Mon Sep 17 00:00:00 2001 From: Michael Daniels Date: Sun, 12 Jul 2026 14:37:38 -0400 Subject: [PATCH] topgrade: fix Darwin build Fixes https://hydra.nixos.org/build/337394047 --- pkgs/by-name/to/topgrade/package.nix | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/to/topgrade/package.nix b/pkgs/by-name/to/topgrade/package.nix index c3609237d5a3..45ef928a6052 100644 --- a/pkgs/by-name/to/topgrade/package.nix +++ b/pkgs/by-name/to/topgrade/package.nix @@ -4,6 +4,7 @@ fetchFromGitHub, rustPlatform, installShellFiles, + llvmPackages, }: rustPlatform.buildRustPackage (finalAttrs: { @@ -21,14 +22,18 @@ rustPlatform.buildRustPackage (finalAttrs: { nativeBuildInputs = [ installShellFiles - ]; + ] + # TODO: Remove once #536365 reaches this branch + ++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.lld ]; - env.NIX_CFLAGS_COMPILE = toString ( - lib.optionals stdenv.hostPlatform.isDarwin [ + env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { + NIX_CFLAGS_COMPILE = toString [ "-framework" "AppKit" - ] - ); + ]; + # TODO: Remove once #536365 reaches this branch + NIX_CFLAGS_LINK = "-fuse-ld=lld"; + }; postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' installShellCompletion --cmd topgrade \