The value of such an environment variable must come from somewhere, but there is limited value in it coming from the shell that the current job is running in as the shell/environment was created as a clean instance to run the job.
You can pass parameters to the config.yml as detailed here
https://circleci.com/docs/pipeline-variables/
Sadly, currently, this can only be done via API execution of the project pipeline. What is missing is the ability to map a project’s Environment Variables across to a project’s pipeline variable. The end result is that you have to create a config.yml that has logic included that executes itself via an API call while passing any defined environment variables as project pipeline variables.