This question is related to this question about conda, and it is pretty straightforward:
How can I use an external environment variable inside