Replies: 7 comments
-
Interesting question! I never really considered this, because I use emacs and exec-path-from-shell, but it seems like a valid use case for generic apps. For single binaries, that's very easy: For application launchers it's a different game. I found "https://superuser.com/a/541068/442895", and t turns out there's already exactly one package that does something with that in nixpkgs :) xquartz. Having a more generic tool for that, à la makeWrapper, might actually be quite nice. What kind of API did you have in mind? Full disclosure I don't need this myself so it's very low priority for me. But if you have a design plan and want to submit a PR I'm all 👂 |
Beta Was this translation helpful? Give feedback.
-
For examples elsewhere. Hombrew emacs-plus injects $PATH into Info.plist https://github.com/d12frosted/homebrew-emacs-plus/blob/master/Library/EmacsBase.rb Note the Homebrew Macport version does not. Macports version of emacs-plus https://github.com/macports/macports-ports/blob/master/editors/emacs/files/patch-Info.plist.in.diff does as well . Macports version of Macport seems to do this by patching C code! The Macports version seems to be the one to copy as it is a simple text change whilst Homebrew (and the Quartz nixpkgs mentioned above) uses PlistBuddy which I doubt is in nixpkgs. |
Beta Was this translation helpful? Give feedback.
-
Searching nixpkgs for Info.plist I think there is another example RawTherapee but this is because upstream sets a lot of environment variables to /Applications But that does suggest a general purpose fix might be difficult if LSEnvironment is in upstream code. I think general code would have to parse the Plist file and overnight or add is necessary. If LSEnvironment is not set upstream then should be more easily doable. |
Beta Was this translation helpful? Give feedback.
-
If I ever needthis myself I'll add it 👍 . In the mean time if you need it and feel like submitting a PR , I'm happy to review ! |
Beta Was this translation helpful? Give feedback.
-
I'm closing this issue while awaiting a PR , but feel free to continue discussing here if you want to bounce ideas around |
Beta Was this translation helpful? Give feedback.
-
Thanks both of you. I will look into the suggestions in the meantime! |
Beta Was this translation helpful? Give feedback.
-
Reopened and migrated to discussion. I think I finally understand the point of this github feature now :) |
Beta Was this translation helpful? Give feedback.
-
Could it be possible to inject environment variables, such as $PATH, into the applications? I am asking because certain applications, such as IntelliJ, cannot locate binaries from Nix, such as git-lfs, if not launched through a terminal that already has the environment variables set.
Given that this project already performs some magical operations for the applications installed through the home manager, I thought there might be a way to achieve this.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions