I’m at my first steps trying to set up a reproducible development environment for developing Clang tools.
In my case my clang tool performs source-code level transformation.
So far I’ve created a flake-based shell.nix and inside
nix develop my program compiles fine. But, from what I got from these two threads  , just like other unwrapped clang tools, my program can’t find header files which are typically found in places like
I tried to use
buildFHSUserEnv but I can only get the libraries end up in
/usr/.... It seems that the header files are not copied to FHS, which maybe relates this issue.
I think my problem is similar to Python + Qt woes, because within a nix shell I’m developing something that needs to be wrapped. But the proposed solution to set up the environment variables in
shellHooks doesn’t work in my case because the environment variables set by the wrapper script for clang tools make compilation fail, probably because
CPLUS_INCLUDE_PATH also influence the compiler. So I guess I need to wrap my program, so that the environment is only applied to my program, rather than the whole shell.
So fundamentally I guess my question is: is there a neat way to wrap a program that is compiled inside a nix shell on-the-fly, without too much developer intervention each time the program is recompiled?