I’m working on a project built with Nim that requires libpcre. There is no point in Nix-ifying it because it’s an external project that I just want to build to verify my change works.
You should consider building insude a nix developpment environment, a.k.a a nix shell, from the nix-shell command used to do so.
$ nix-shell -p pcre # or pcre2, pcre-cpp, as you wish
[nix-shell:~]$ ./confiugure; make # or whatever nim requires
You should stuff all your dependencies on that invocation. Like gcc, nim and the like. If you feel lucky, add the --pure argument to the nix-shell invocation. This will hide your global environment, and thus fail if you missed dependencies on the command line.
If you are curious, have a look at all the environment variables that nix-shell changes with this zsh command: