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 {