From 819e9f8b1bd3bf04e57be2c86c5e1c767ed1f199 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 f4b551b6..bdcae9d2 100644 --- a/flake.nix +++ b/flake.nix @@ -324,6 +324,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