Create a file called envrionment.plist in ~/Library/LaunchAgents
The file should have the following content. Remember to change the paths in bold to your own locations.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>my.startup</string> <key>ProgramArguments</key> <array> <string>sh</string> <string>-c</string> <string> launchctl setenv NEXUS_LICENSE /path/to/license launchctl setenv NEXUS_PREFS /path/to/prefs launchctl setenv NEXUS_USER /path/to/user </string> </array> <key>RunAtLoad</key> <true/> </dict> </plist>