How to add `.desktop` for a script to let it display on desktop menu?

I have a flake containing some of my modified packages, and one of them is like this:

finamp = pkgs.writeShellScriptBin "finamp" ''
  GDK_SCALE=2 exec ${pkgs.lib.getExe pkgs.finamp} "$@"
'';

However the application does not shows up in the desktop menu, so I have to launch it in terminal. I guess I have to add a .desktop file somewhere ( for some distro maybe like /usr/share/applications/ ?) to make it in the menu, but I do not know exactly where and how in NixOS.
I found a function makeDesktopItem but I do not know how to fit it in this case.

Could someone help? Thanks!

I tend to (ab)use symlinkJoin for this.

  let
    pname = ...;
    version = ...;
  in
  symlinkJoin {
    inherit pname version;
    name = "${pname}-${version}";
    paths = [
      (writeShellScriptBin pname ''
        ...
      '')
      (makeDesktopItem {
        name = "com.example.${pname}";
        exec = pname;
        # ...
      })
    ];
  }

Genius! Thanks!
I think it is designed to (ab)use it this way.