Pass environment variables to nix develop or nix shell
masterNix runs in 'pure mode' by default, which prevents environment variables from being passed through. To use specific variables, use the --keep (or -k) flag to whitelist them, or use the --impure flag to disable pure mode entirely.
# Using --keep to whitelist a specific variable
nix develop --ignore-environment --keep MY_ENV_VAR --command echo $MY_ENV_VAR
# Disabling pure mode entirely
nix develop --impure