mmi: add environment variables to generated script