Hi all, I’ve tried a couple times to use NixOS, but I’ve found that it’s quite hard to use NixOS on the projects I tend to work on.
For example, if I compile LLVM and clang locally so I can make some patches to them, then the resulting compiler won’t have been wrapped like the clang packages in nixpkgs and so won’t be able to find the libcxx include paths (or other things that are normally in system include paths). This all happens in a pure nix-shell environment that has all the build dependencies I need.
I asked on IRC about this, and it was suggested that I manually replace the
clang binary in my build folder with a wrapper script like that of the wrapped clang packages. However, I don’t feel that this is an elegant solution.
The script will be replaced whenever I rebuild (if it is named
clang and I move the binary to
clang-unwrapped or something like that). As all of the test suites will execute the
clang binary directly, a script that lives as a sibling to the
clang binary isn’t feasible either. Further, as I want to be able to iterate, re-build and test within the nix-shell with different commands and flags, I don’t want to have to specify these in the
default.nix file and do all building and testing through that, so that I can call
While my use case isn’t common, I feel it is an area where there the Nix tooling makes working on a project much harder and less streamlined that it would be in other distributions (I otherwise love Nix for other projects, this is certainly an outlier). I was wondering if anyone had any suggestions for better solutions to this problem (if Nix can already handle this elegantly), or any ideas for how the Nix tooling could make this problem easier to solve?