I am trying to make a .desktop file for a custom package. My package works fine if i run /result/bin/foo on terminal but is lacking some libraries if i try the bash script !#bin/bash exec ~/result/bin/foo or if i simply put exec = ~/result/bin/foo on the .desktop file.
The nix way to get the direct access would probably be to make my package into a flake and put it in my configuration, but now i am very intrigued as to why my approach doesn’t work.
Putting it in your configuration is indeed the nix way to work with something like this, though there’s absolutely no reason it needs to be a flake for that…
As for why it only works when run from the terminal… Is the terminal you’re running it from a dev shell? If not, I have trouble seeing why those different execution methods would give different results.
I mean, there are things I can think of, but have no idea if they apply without more specifics. For example, kitty leaks its python environment to the program (usually a shell) that it runs inside the terminal, and if your program is also python-based, that could be creating a difference. But I have no idea if your program has anything to do with python.