From cc28a73a59f63669d2ca643160a0640c48a7e13e Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Mon, 29 Jun 2026 18:41:08 +0900 Subject: [PATCH] nix: fix cargo in darwin nix devshell Signed-off-by: Seongmin Lee --- flake.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flake.nix b/flake.nix index 834e529a..5e276133 100644 --- a/flake.nix +++ b/flake.nix @@ -329,6 +329,10 @@ ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [ pkgs.darwin.cctools ]; + } + // pkgs.lib.optionalAttrs pkgs.stdenv.isDarwin { + # Point cargo's linker at the nix cc-wrapper so NIX_LDFLAGS applies. + "CARGO_TARGET_${pkgs.lib.toUpper (builtins.replaceStrings ["-"] ["_"] pkgs.stdenv.hostPlatform.rust.rustcTarget)}_LINKER" = "${pkgs.pkgsStatic.stdenv.cc.targetPrefix}cc"; }); in { default = staticShell { -- 2.51.2