[Nix-dev] Generating desktop files

Eelco Dolstra e.dolstra at tudelft.nl
Tue May 12 09:48:38 CEST 2009


Hi,

Sander van der Burg - EWI wrote:

> I just created a makeDesktopItem function in Nixpkgs, which you can use
> to generate .desktop files for applications that do not include .desktop
> files in their tarballs, such as Mozilla Firefox.

Maybe it would be nice to have this as a shell function that can be called from
postInstall hooks.  That way we wouldn't have to create a wrapper package for
everything.

Or even better, makeDesktopItem could be a setup hook that hooks itself into
postInstall and uses derivation attributes to create a desktop item.  Something
like this:

  stdenv.mkDerivation {
    name = "foo-1.2.3";

    buildInputs = [makeDesktopItem ...];

    desktopItemName = "foo";
    desktopItemIcon = ...;
    ...
  }

> I modified the Firefox wrapper function so that it will include a
> .desktop file. By providing a desktop file, a user can pick the Firefox
> webbrowser from the KDE/GNOME application launcher menu when Firefox is
> installed in the users' profile.

In the Firefox wrapper you have:

 desktopItem = makeDesktopItem {
    name = browserName;
    exec = browserName;

Wouldn't it be better to have the absolute path to the Firefox wrapper here?
Might be useful for handling cases where users have multiple profiles or
different versions of a package installed.

-- 
Eelco Dolstra | http://www.st.ewi.tudelft.nl/~dolstra/



More information about the nix-dev mailing list