From c64821cb25f7fbb7613114891216e8cf910cf441 Mon Sep 17 00:00:00 2001 From: Johannes Kresner Date: Fri, 13 Nov 2026 14:06:57 +0100 Subject: [PATCH] fix: standard cc availability on macos --- nix/module.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/nix/module.nix b/nix/module.nix index 09c6ed1..8ab0d05 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -10,13 +10,17 @@ let full = cfg.profile == "full"; # Slim also needs tree-sitter and a C compiler so its few parsers can compile. - baseTools = with pkgs; [ - ripgrep - fd - git - tree-sitter - stdenv.cc - ]; + # On macOS the Xcode clang does that; Nix's clang wrapper would shadow /usr/bin/cc + # and break cgo links (it can't find SDK libs like -lresolv outside a nix shell). + baseTools = + with pkgs; + [ + ripgrep + fd + git + tree-sitter + ] + ++ lib.optional stdenv.hostPlatform.isLinux stdenv.cc; # rustup supplies cargo, rustfmt, clippy and rust-analyzer (and the nightly # toolchain fff builds with), so those are not listed separately.