Clang, clang++, and clangd can't find headers, even with compile_commands.json

What you’re meant to do is override the stdenv if you want it to use clang:

  pkgs.mkShell.override { stdenv = pkgs.clang19Stdenv; } {
    packages = [
      pkgs.cmake
      # ... whatever else, but NOT C compilers though!
    ];
  }

(or inherit (pkgs.llvmPackages_19) stdenv;, if you prefer)

and instead of the deprecated devShell.<system>, use devShells.<system>.default.