I have a flake with a devShell that uses clang 17:
devShells = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
frameworks = pkgs.darwin.apple_sdk_11_0.frameworks;
mkShell = pkgs.mkShell.override {stdenv = pkgs.llvmPackages_17.stdenv;};
in {
default = mkShell {
buildInputs = with pkgs; [
cmake
ninja
llvmPackages_17.bintools-unwrapped
clang-tools_17
lldb_17
] ++ lib.optionals stdenv.isDarwin [ darwin.DarwinTools frameworks.ApplicationServices ];
};
});
So here’s the problem: there are executable provided by clang that are the same as in clang-tools. For example:
$ type clangd
clangd is /nix/store/yq6k6rbc50ylcbixkxbzjh9i9a9zplyh-clang-17.0.6/bin/clangd
This is bad news for me, since this clangd executable cannot find standard headers.
The same goes on with clang-tidy.
I want to use the executable provided by clang-tools_17
, is there a way to tell nix to prioritize that package over the ones from the stdenv? Thanks.