It’s surprising difficult to set environment variables in MacOS. You have to use launchctl setenv in the Terminal, and even that doesn’t persist across restarts (you need to add a launch agent for that). Credit to Windows which, while dated, at least has a UI for this.