LnL7 / nix-darwin

nix modules for darwin
MIT License
2.82k stars 431 forks source link

Feature request: `home.sessionVariables` from Home Manager should be included in `launchd.user.envVariables` #1056

Closed booxter closed 1 week ago

booxter commented 3 weeks ago

MacOS does not source shell configuration for GUI apps. It means that settings done in Home Manager with sessionVariables are available only to apps started from a terminal. It may be helpful to allow home-manager modules to set variables for user environment GUI apps. In the example linked, environment variables are set that allow to run Firefox installed from homebrew with Home Manager generated profiles.ini. But this doesn't work when Firefox is executed from MacOS UI (it does work when it's executed from a shell.)

Right now, to make this work, I have to duplicate the same setting in my setup flake - for launchd and for home-manager. I'd prefer if we could configure it once (automatically by the Home Manager module, see the PR linked) and get the setting propagated to GUI startup.

booxter commented 1 week ago

The launchd module here is effectively in flux and buggy; I'm moving the logic to home-manager.