Dillema regarding a package writing to a permanent file it's executable path

I need the community’s advice to help me design the behavior of a package I maintain:

This package (syncthingtray), has a button in its settings window, that enables / disables automatically starting it on login, via adding / removing a ~/.config/autostart/...desktop file. The application itself generates the .dekstop file when that option is enabled in the settings.

The problem is with the Exec=<path-to-app-executable> line it writes in the .desktop file. Since this is a QT package which is also wrapped during build, certainly it should write there the wrapper’s path. However, even that path will become unavailable when one updates their system and runs nix-collect-garbage -d.

The solution I propose in PR 209062 is to add an argument to the package call, that will enable to use a permanent path such as /run/current-system/sw/bin/syncthingtray or to the Exec= directive. A different path can be chosen if you .override the package.

Do you think such a design is good for Nix? Or is it too hardcoded?

Would it be an option to drop the path entirely?

What do you mean by “dropping” the path?

Can you assume the target executable is on $PATH and call it by its filename, letting the shell find the app among the dirs listed on $PATH?

Indeed that’ seems to be the best option! Thanks