It is working but i get the warning that it has been deprecated and will be removed.
evaluation warning: `commandLineArgs` has been deprecated and will be removed in the future. Consider creating a wrapper script or a desktop entry with your desired flags.
My problem is that i don’t want to have two start menu entries for signal if i create an extra desktop entry.
How can i add the startup flag without having two “Signal” programs in my startup menu?
That’s the worst possible solution to this problem. It forces full rebuilds because you’re overriding the original package.
Using an overlay to apply the override is also completely overkill for a simple leaf package, which is going to be the case for all packages where you want to use a .desktop file. But you shouldn’t be overriding to begin with, and @gamebeaker already corrected that.
The good way to do this is to follow the xdg spec’s intended mechanism, add a .desktop file with the same name to a higher-priority path.
You should also never use the fully qualified binary path in .desktop files, because DEs do silly things with these files that can result in them becoming non-symlinks and eventually breaking (hence I don’t use lib.getExe in my example). The file works fine as long as a binary with that name is in $PATH.
If you must include the desktop file in the package, at least use symlinkJoin and friends instead of overrideAttrs so that you don’t have to rebuild the package:
Yeah, I also find just writing out the string easier than using makeDesktopItem.
You can consider using builtins.toTOML to convert nix to a TOML string if you want to use nix functions (the format isn’t quite TOML, but mostly compatible).