From 79a50c0473d83e8c76dbf4a5a5473feeee4e151c Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Wed, 25 May 2016 19:24:50 -0400 Subject: [PATCH] sublime: add a desktop item and icons --- pkgs/applications/editors/sublime/default.nix | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/editors/sublime/default.nix b/pkgs/applications/editors/sublime/default.nix index a002d14c98c8..1f4be1ac5085 100644 --- a/pkgs/applications/editors/sublime/default.nix +++ b/pkgs/applications/editors/sublime/default.nix @@ -1,4 +1,4 @@ -{ fetchurl, stdenv, glib, xorg, cairo, gtk}: +{ fetchurl, stdenv, glib, xorg, cairo, gtk, makeDesktopItem }: let libPath = stdenv.lib.makeLibraryPath [glib xorg.libX11 gtk cairo]; in @@ -31,8 +31,27 @@ stdenv.mkDerivation rec { --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ --set-rpath ${libPath}:${stdenv.cc.cc.lib}/lib${stdenv.lib.optionalString stdenv.is64bit "64"} \ $out/sublime/sublime_text + + mkdir -p $out/share/icons + + for x in $(ls $out/sublime/Icon); do + mkdir -p $out/share/icons/hicolor/$x/apps + cp -v $out/sublime/Icon/$x/* $out/share/icons/hicolor/$x/apps + done + + ln -sv "${desktopItem}/share/applications" $out/share ''; + desktopItem = makeDesktopItem { + name = "sublime2"; + exec = "sublime2 %F"; + comment = meta.description; + desktopName = "Sublime Text"; + genericName = "Text Editor"; + categories = "TextEditor;Development;"; + icon = "sublime_text"; + }; + meta = { description = "Sophisticated text editor for code, markup and prose"; license = stdenv.lib.licenses.unfree;