-
|
I am trying to use wrapper modules on darwin/macOS, and for anything launched from the terminal it works without problems, since executables in As such when running one of these apps from Spotlight (macOS' app launcher), the wrapped binary is not run and therefore flags and configurations not applied. Is it possible to wrap these as well? So far I haven't been successful in my attempts, but I'd love to see nix-wrapper-modules support this. Perhaps relevant prior art: |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
|
So, yes. But I didn't know about it before yesterday, as I was reviewing exactly the derivation you linked. It seems most nix derivations don't offer this? you would basically have to wrap it separately, or link it there. Is it the exact same binary always? If so, it might be easiest just to link it there, if mac allows that value to be a link? Or copy it? buildCommand.macAppBundle = ''
mkdir -p ${config.outputName}/Applications/Ghostty.app/Contents/MacOS
ln -s ${config.wrapperPaths.placeholder} ${config.outputName}/Applications/Ghostty.app/Contents/MacOS/ghostty
'';If not, then wrapperVariants.ghostty = {
exePath = "Applications/Ghostty.app/Contents/MacOS/ghostty";
binDir = "Applications/Ghostty.app/Contents/MacOS";
};It is possible that mac needs it to not only be not a link, but also a binary rather than a script. If so, wrapperVariants.ghostty = {
exePath = "Applications/Ghostty.app/Contents/MacOS/ghostty";
binDir = "Applications/Ghostty.app/Contents/MacOS";
wrapperImplementation = "binary";
};And if it didnt already have one present, and you wanted to make one, you can either copy it there just like above, or you could do the wrapperVariants thing, but you would set exePath to be pointing just at |
Beta Was this translation helpful? Give feedback.
-
|
Tysm for the quick and elaborate response! macOS does need it to be a binary, and works pretty well with your 3rd suggestion. Does not work: (Wrapped exe variant is still a bash script) {
wrapperVariants.ghostty = {
exePath = "Applications/Ghostty.app/Contents/MacOS/ghostty";
binDir = "Applications/Ghostty.app/Contents/MacOS";
wrapperImplementation = "binary";
};
}Works: (But {
wrapperImplementation = "binary";
wrapperVariants.ghostty = {
exePath = "Applications/Ghostty.app/Contents/MacOS/ghostty";
binDir = "Applications/Ghostty.app/Contents/MacOS";
};
}Is this a potential bug? |
Beta Was this translation helpful? Give feedback.
-
|
Thanks so much you both for this discussion. I learned a lot. Does it install Ghostty under Cheers! |
Beta Was this translation helpful? Give feedback.
So, yes. But I didn't know about it before yesterday, as I was reviewing exactly the derivation you linked.
It seems most nix derivations don't offer this?
you would basically have to wrap it separately, or link it there.
Is it the exact same binary always?
If so, it might be easiest just to link it there, if mac allows that value to be a link? Or copy it?
If not, then
wrapperVariantswill repeat the wrapper instructions for some other binary