24 # from justinwoo/azuredatastudio-nix
25 # https://github.com/justinwoo/azuredatastudio-nix/blob/537c48aa3981cd1a82d5d6e508ab7e7393b3d7c8/default.nix
28 desktopItem = makeDesktopItem {
29 name = "azuredatastudio";
30 desktopName = "Azure Data Studio";
31 comment = "Data Management Tool that enables you to work with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux.";
32 genericName = "Text Editor";
33 exec = "azuredatastudio --no-sandbox --unity-launch %F";
34 icon = "azuredatastudio";
36 startupWMClass = "azuredatastudio";
37 categories = [ "Utility" "TextEditor" "Development" "IDE" ];
38 mimeTypes = [ "text/plain" "inode/directory" "application/x-azuredatastudio-workspace" ];
39 keywords = [ "azuredatastudio" ];
40 actions.new-empty-window = {
41 name = "New Empty Window";
42 exec = "azuredatastudio --no-sandbox --new-window %F";
43 icon = "azuredatastudio";
47 urlHandlerDesktopItem = makeDesktopItem {
48 name = "azuredatastudio-url-handler";
49 desktopName = "Azure Data Studio - URL Handler";
50 comment = "Azure Data Studio";
51 genericName = "Text Editor";
52 exec = "azuredatastudio --no-sandbox --open-url %U";
53 icon = "azuredatastudio";
55 startupWMClass = "azuredatastudio";
56 categories = [ "Utility" "TextEditor" "Development" "IDE" ];
57 mimeTypes = [ "x-scheme-handler/azuredatastudio" ];
58 keywords = [ "azuredatastudio" ];
62 stdenv.mkDerivation rec {
64 pname = "azuredatastudio";
67 desktopItems = [ desktopItem urlHandlerDesktopItem ];
70 name = "${pname}-${version}.tar.gz";
71 url = "https://azuredatastudio-update.azurewebsites.net/${version}/linux-x64/stable";
72 sha256 = "sha256-b/ha+81TlffnvSENzaePvfFugcKJffvjRU7y+x60OuQ=";
89 mkdir -p $out/share/pixmaps
90 cp ${targetPath}/resources/app/resources/linux/code.png $out/share/pixmaps/azuredatastudio.png
95 # change this to azuredatastudio-insiders for insiders releases
96 edition = "azuredatastudio";
97 targetPath = "$out/${edition}";
100 mkdir -p ${targetPath}
101 ${gnutar}/bin/tar xf $src --strip 1 -C ${targetPath}
104 sqltoolsserviceRpath = lib.makeLibraryPath [
114 # this will most likely need to be updated when azuredatastudio's version changes
115 sqltoolsservicePath = "${targetPath}/resources/app/extensions/mssql/sqltoolsservice/Linux/3.0.0-release.215";
117 rpath = lib.concatStringsSep ":" [
120 lib.makeLibraryPath [
137 fix_sqltoolsservice()
139 mv ${sqltoolsservicePath}/$1 ${sqltoolsservicePath}/$1_old
141 --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" \
142 ${sqltoolsservicePath}/$1_old
145 ${sqltoolsservicePath}/$1_old \
146 ${sqltoolsservicePath}/$1 \
147 --set LD_LIBRARY_PATH ${sqltoolsserviceRpath}
150 fix_sqltoolsservice MicrosoftSqlToolsServiceLayer
151 fix_sqltoolsservice MicrosoftSqlToolsCredentials
152 fix_sqltoolsservice SqlToolsResourceProviderService
155 --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" \
156 ${targetPath}/${edition}
160 ${targetPath}/bin/${edition} \
161 $out/bin/azuredatastudio \
162 --set LD_LIBRARY_PATH ${rpath}
166 maintainers = with lib.maintainers; [ xavierzwirtz ];
167 description = "A data management tool that enables working with SQL Server, Azure SQL DB and SQL DW";
168 homepage = "https://docs.microsoft.com/en-us/sql/azure-data-studio/download-azure-data-studio";
169 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
170 license = lib.licenses.unfreeRedistributable;
171 platforms = [ "x86_64-linux" ];