(I think creating a new thread and linking to the old one is perfectly fine.)
I’m having problems with clang-tidy from nixpkgs too.
This is what I found so far:
The clang-tidy you’re running there is the unwrapped one. If you explicitly add clang-tools to the nativeBuildInputs list you get the wrapped one. (Maybe it’s a packaging bug that we add the unwrapped one implicitly. Why would we ever want that?)
With the wrapped clang-tidy in $PATH, it’ll find headers like <iostream>.
The next problem is cang-tidy barfs on #include <cmath>!