From 935493a3610ca1830a22c92685eb58622fa2366a Mon Sep 17 00:00:00 2001 From: Jakob Gillich Date: Fri, 22 Apr 2016 12:27:38 +0200 Subject: [PATCH] vscode: add desktop file --- pkgs/applications/editors/vscode/default.nix | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/editors/vscode/default.nix b/pkgs/applications/editors/vscode/default.nix index 5e8a39bb101d..f5b204b074ed 100644 --- a/pkgs/applications/editors/vscode/default.nix +++ b/pkgs/applications/editors/vscode/default.nix @@ -1,4 +1,5 @@ -{ stdenv, lib, callPackage, fetchurl, unzip, atomEnv }: +{ stdenv, lib, callPackage, fetchurl, unzip, atomEnv, makeDesktopItem }: + let version = "0.10.10"; @@ -23,12 +24,28 @@ in inherit sha256; }; + desktopItem = makeDesktopItem { + name = "code"; + exec = "code"; + icon = "code"; + comment = "Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications"; + desktopName = "Visual Studio Code"; + genericName = "Text Editor"; + categories = "GNOME;GTK;Utility;TextEditor;Development;"; + }; + buildInputs = [ unzip ]; installPhase = '' mkdir -p $out/lib/vscode $out/bin cp -r ./* $out/lib/vscode ln -s $out/lib/vscode/code $out/bin + + mkdir -p $out/share/applications + cp $desktopItem/share/applications/* $out/share/applications + + mkdir -p $out/share/pixmaps + cp $out/lib/vscode/resources/app/resources/linux/code.png $out/share/pixmaps/code.png ''; fixupPhase = lib.optionalString (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") ''