34 # from justinwoo/azuredatastudio-nix
35 # https://github.com/justinwoo/azuredatastudio-nix/blob/537c48aa3981cd1a82d5d6e508ab7e7393b3d7c8/default.nix
38 desktopItem = makeDesktopItem {
39 name = "azuredatastudio";
40 desktopName = "Azure Data Studio";
41 comment = "Data Management Tool that enables you to work with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux.";
42 genericName = "Text Editor";
43 exec = "azuredatastudio --no-sandbox --unity-launch %F";
44 icon = "azuredatastudio";
46 startupWMClass = "azuredatastudio";
47 categories = [ "Utility" "TextEditor" "Development" "IDE" ];
48 mimeTypes = [ "text/plain" "inode/directory" "application/x-azuredatastudio-workspace" ];
49 keywords = [ "azuredatastudio" ];
50 actions.new-empty-window = {
51 name = "New Empty Window";
52 exec = "azuredatastudio --no-sandbox --new-window %F";
53 icon = "azuredatastudio";
57 urlHandlerDesktopItem = makeDesktopItem {
58 name = "azuredatastudio-url-handler";
59 desktopName = "Azure Data Studio - URL Handler";
60 comment = "Azure Data Studio";
61 genericName = "Text Editor";
62 exec = "azuredatastudio --no-sandbox --open-url %U";
63 icon = "azuredatastudio";
65 startupWMClass = "azuredatastudio";
66 categories = [ "Utility" "TextEditor" "Development" "IDE" ];
67 mimeTypes = [ "x-scheme-handler/azuredatastudio" ];
68 keywords = [ "azuredatastudio" ];
72 stdenv.mkDerivation rec {
74 pname = "azuredatastudio";
77 desktopItems = [ desktopItem urlHandlerDesktopItem ];
80 name = "${pname}-${version}.tar.gz";
82 # Url can be found at: https://github.com/microsoft/azuredatastudio/releases
83 # In the downloads table for Linux .tar.gz
84 # This will give a go.microsoft redirect link, I think it's better to use the direct link to which the redirect points.
85 # You can do so by using curl: curl -I <go.microsoft link>
86 url = "https://download.microsoft.com/download/7/8/3/783c2037-8607-43c4-a593-0936e965d38b/azuredatastudio-linux-1.49.1.tar.gz";
87 sha256 = "sha256-0LCrRUTTe8UEDgtGLvxVQL8pA5dwA6SvZEZSDILr7jo=";
104 mkdir -p $out/share/pixmaps
105 cp ${targetPath}/resources/app/resources/linux/code.png $out/share/pixmaps/azuredatastudio.png
110 # change this to azuredatastudio-insiders for insiders releases
111 edition = "azuredatastudio";
112 targetPath = "$out/${edition}";
115 mkdir -p ${targetPath}
116 ${gnutar}/bin/tar xf $src --strip 1 -C ${targetPath}
119 sqltoolsserviceRpath = lib.makeLibraryPath [
129 # this will most likely need to be updated when azuredatastudio's version changes
130 sqltoolsservicePath = "${targetPath}/resources/app/extensions/mssql/sqltoolsservice/Linux/5.0.20240724.1";
132 rpath = lib.concatStringsSep ":" [
133 (lib.makeLibraryPath [
166 fix_sqltoolsservice()
168 mv ${sqltoolsservicePath}/$1 ${sqltoolsservicePath}/$1_old
170 --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" \
171 ${sqltoolsservicePath}/$1_old
174 ${sqltoolsservicePath}/$1_old \
175 ${sqltoolsservicePath}/$1 \
176 --set LD_LIBRARY_PATH ${sqltoolsserviceRpath}
179 fix_sqltoolsservice MicrosoftSqlToolsServiceLayer
180 fix_sqltoolsservice MicrosoftSqlToolsCredentials
181 fix_sqltoolsservice SqlToolsResourceProviderService
184 --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" \
185 ${targetPath}/${edition}
189 ${targetPath}/bin/${edition} \
190 $out/bin/azuredatastudio \
191 --set LD_LIBRARY_PATH ${rpath}
195 maintainers = with lib.maintainers; [ xavierzwirtz ];
196 description = "Data management tool that enables working with SQL Server, Azure SQL DB and SQL DW";
197 homepage = "https://docs.microsoft.com/en-us/sql/azure-data-studio/download-azure-data-studio";
198 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
199 license = lib.licenses.unfreeRedistributable;
200 platforms = [ "x86_64-linux" ];
201 mainProgram = "azuredatastudio";