Setting the system-wide PATH environment variable in Mavericks
Yosemite

/etc/launchd.conf is no longer supported in 10.10. See man launchctl:


  The /etc/launchd.conf file is no longer consulted for subcommands to run during early boot time; this functionality was removed for security considerations.


You can now for example save this plist as ~/Library/LaunchAgents/my.startup.plist:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
  &lt;key&gt;Label&lt;/key&gt;
  &lt;string&gt;my.startup&lt;/string&gt;
  &lt;key&gt;ProgramArguments&lt;/key&gt;
  &lt;array&gt;
    &lt;string&gt;sh&lt;/string&gt;
    &lt;string&gt;-c&lt;/string&gt;
    &lt;string&gt;launchctl setenv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin&lt;/string&gt;
  &lt;/array&gt;
  &lt;key&gt;RunAtLoad&lt;/key&gt;
  &lt;true/&gt;
&lt;/dict&gt;
&lt;/plist&gt;


The launchctl setenv command is ran as the user, so it only applies to processes launched in the user domain.

This method doesn't apply to applications that are reopened at login if "Reopen windows when logging back in" is checked.

Mavericks and earlier

In 10.9 and earlier, you can for example run

echo setenv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin|sudo tee -a /etc/launchd.conf


and then restart to apply the changes.

Other methods

/etc/paths and /etc/paths.d/ apply only (or mainly) to shells. The lines in /etc/paths and /etc/paths.d/* are added to the path by path_helper, which is run from /etc/profile, /etc/zshenv, and /etc/csh.login. I don't know any programs other than shells that would consider /etc/paths or /etc/paths.d/.

~/.MacOSX/environment.plist stopped working in 10.8.