I've got a Snakemake workflow which requires two separate conda environments, and one rule potentially downloads files and saves them into directories in the conda environment's path if they're missing (if you're curious: primer schemes and medaka models being automatically downloaded in the ARTIC pipeline). To avoid issues when multiple instances of that rule are run simultaneously for the first time in a new environment, I've inserted other rules to check for the presence of these files and pre-download them if needed (by having them be prerequisites of the offending rule).
Currently, I'm handling this with checkfiles, but I've been wondering if there was a way to access the paths of the various conda environments Snakemake is using within the Snakefile, equivalent to $CONDA_PREFIX in the shell, so I could check for the files directly? (Finding the environment with --list-conda-envs and hardcoding it isn't really an option, as it's supposed to be portable.)
EDIT: @dariober's answer nudged me into working out a workaround for this case - working out that artic minion could take a path for the --medaka-model argument and downloading the model somewhere less irritating to work with - and that's solved it (thanks!), but I still wonder: is there something, for example somewhere in snakemake.conda, that one could use to get at a Snakemake-created conda environment's path without having to find and hardcode it in a case where there's no such workaround?