[nim, argha] Copied spawn_env script to fix provisioning bugs