Setting up a nix-env that can compile C libraries

Did you consider trying that option ?