I got so annoyed with this and the fact that I do development in both mac and linux that switched to do all my development inside a container.
I just made a bash script that shells into the container (or starts it if it is not already running) and in there everything is set up.