@@ -10,7 +10,18 @@
1010with lib;
1111
1212let
13− mkJetBrainsProduct = callPackage ./common.nix { inherit vmopts; };
13+ platforms = lib.platforms.linux ++ [ "x86_64-darwin" "aarch64-darwin" ];
14+ ideaPlatforms = [ "x86_64-darwin" "i686-darwin" "i686-linux" "x86_64-linux" "aarch64-darwin" ];
15+
16+ inherit (stdenv.hostPlatform) system;
17+
18+ versions = builtins.fromJSON (readFile (./versions.json));
19+ versionKey = if stdenv.isLinux then "linux" else system;
20+ products = versions.${versionKey} or (throw "Unsupported system: ${system}");
21+
22+ package = if stdenv.isDarwin then ./darwin.nix else ./linux.nix;
23+ mkJetBrainsProduct = callPackage package { inherit vmopts; };
24+
1425 # Sorted alphabetically
1526
1627 buildClion = { name, version, src, license, description, wmClass, ... }:
@@ -19,13 +30,12 @@ let
1930 product = "CLion";
2031 meta = with lib; {
2132 homepage = "https://www.jetbrains.com/clion/";
22− inherit description license;
33+ inherit description license platforms;
2334 longDescription = ''
2435 Enhancing productivity for every C and C++
2536 developer on Linux, macOS and Windows.
2637 '';
2738 maintainers = with maintainers; [ edwtjo mic92 ];
28− platforms = platforms.linux;
2939 };
3040 }).overrideAttrs (attrs: {
3141 nativeBuildInputs = (attrs.nativeBuildInputs or []) ++ optionals (stdenv.isLinux) [
@@ -58,14 +68,13 @@ let
5868 product = "DataGrip";
5969 meta = with lib; {
6070 homepage = "https://www.jetbrains.com/datagrip/";
61− inherit description license;
71+ inherit description license platforms;
6272 longDescription = ''
6373 DataGrip is a new IDE from JetBrains built for database admins.
6474 It allows you to quickly migrate and refactor relational databases,
6575 construct efficient, statically checked SQL queries and much more.
6676 '';
6777 maintainers = with maintainers; [ ];
68− platforms = platforms.linux;
6978 };
7079 });
7180
@@ -75,7 +84,7 @@ let
7584 product = "Goland";
7685 meta = with lib; {
7786 homepage = "https://www.jetbrains.com/go/";
78− inherit description license;
87+ inherit description license platforms;
7988 longDescription = ''
8089 Goland is the codename for a new commercial IDE by JetBrains
8190 aimed at providing an ergonomic environment for Go development.
@@ -83,10 +92,9 @@ let
8392 and tool integrations specific for the Go language
8493 '';
8594 maintainers = [ maintainers.miltador ];
86− platforms = platforms.linux;
8795 };
8896 }).overrideAttrs (attrs: {
89− postFixup = (attrs.postFixup or "") + ''
97+ postFixup = (attrs.postFixup or "") + lib.optionalString stdenv.isLinux ''
9098 interp="$(cat $NIX_CC/nix-support/dynamic-linker)"
9199 patchelf --set-interpreter $interp $out/goland*/plugins/go/lib/dlv/linux/dlv
92100
@@ -98,10 +106,10 @@ let
98106 '';
99107 });
100108
101− buildIdea = { name, version, src, license, description, wmClass, ... }:
109+ buildIdea = { name, version, src, license, description, wmClass, product, ... }:
102110 (mkJetBrainsProduct {
103− inherit name version src wmClass jdk;
104− product = "IDEA";
111+ inherit name version src wmClass jdk product;
112+ productShort = "IDEA";
105113 extraLdPath = [ zlib ];
106114 extraWrapperArgs = [
107115 ''--set M2_HOME "${maven}/maven"''
@@ -116,18 +124,18 @@ let
116124 with JUnit, TestNG, popular SCMs, Ant & Maven. Also known
117125 as IntelliJ.
118126 '';
119− maintainers = with maintainers; [ edwtjo gytis-ivaskevicius ];
120− platforms = [ "x86_64-darwin" "i686-darwin" "i686-linux" "x86_64-linux" ];
127+ maintainers = with maintainers; [ edwtjo gytis-ivaskevicius steinybot ];
128+ platforms = ideaPlatforms;
121129 };
122130 });
123131
124− buildMps = { name, version, src, license, description, wmClass, ... }:
132+ buildMps = { name, version, src, license, description, wmClass, product, ... }:
125133 (mkJetBrainsProduct rec {
126− inherit name version src wmClass jdk;
127− product = "MPS";
134+ inherit name version src wmClass jdk product;
135+ productShort = "MPS";
128136 meta = with lib; {
129137 homepage = "https://www.jetbrains.com/mps/";
130− inherit license description;
138+ inherit license description platforms;
131139 longDescription = ''
132140 A metaprogramming system which uses projectional editing
133141 which allows users to overcome the limits of language
@@ -135,7 +143,6 @@ let
135143 diagrams.
136144 '';
137145 maintainers = with maintainers; [ rasendubi ];
138− platforms = platforms.linux;
139146 };
140147 });
141148
@@ -145,24 +152,23 @@ let
145152 product = "PhpStorm";
146153 meta = with lib; {
147154 homepage = "https://www.jetbrains.com/phpstorm/";
148− inherit description license;
155+ inherit description license platforms;
149156 longDescription = ''
150157 PhpStorm provides an editor for PHP, HTML and JavaScript
151158 with on-the-fly code analysis, error prevention and
152159 automated refactorings for PHP and JavaScript code.
153160 '';
154161 maintainers = with maintainers; [ schristo ma27 ];
155− platforms = platforms.linux;
156162 };
157163 });
158164
159− buildPycharm = { name, version, src, license, description, wmClass, ... }:
165+ buildPycharm = { name, version, src, license, description, wmClass, product, ... }:
160166 (mkJetBrainsProduct {
161− inherit name version src wmClass jdk;
162− product = "PyCharm";
167+ inherit name version src wmClass jdk product;
168+ productShort = "PyCharm";
163169 meta = with lib; {
164170 homepage = "https://www.jetbrains.com/pycharm/";
165− inherit description license;
171+ inherit description license platforms;
166172 longDescription = ''
167173 Python IDE with complete set of tools for productive
168174 development with Python programming language. In addition, the
@@ -177,11 +183,8 @@ let
177183 and productive development!
178184 '';
179185 maintainers = with maintainers; [ ];
180− platforms = platforms.linux;
181186 };
182− }).override {
183− propagatedUserEnvPkgs = [ python3 ];
184− };
187+ });
185188
186189 buildRider = { name, version, src, license, description, wmClass, ... }:
187190 (mkJetBrainsProduct {
@@ -189,7 +192,7 @@ let
189192 product = "Rider";
190193 meta = with lib; {
191194 homepage = "https://www.jetbrains.com/rider/";
192− inherit description license;
195+ inherit description license platforms;
193196 longDescription = ''
194197 JetBrains Rider is a new .NET IDE based on the IntelliJ
195198 platform and ReSharper. Rider supports .NET Core,
@@ -199,7 +202,6 @@ let
199202 ASP.NET Core web applications.
200203 '';
201204 maintainers = [ maintainers.miltador ];
202− platforms = platforms.linux;
203205 };
204206 }).overrideAttrs (attrs: {
205207 postPatch = lib.optionalString (!stdenv.isDarwin) (attrs.postPatch + ''
@@ -215,10 +217,9 @@ let
215217 product = "RubyMine";
216218 meta = with lib; {
217219 homepage = "https://www.jetbrains.com/ruby/";
218− inherit description license;
220+ inherit description license platforms;
219221 longDescription = description;
220222 maintainers = with maintainers; [ edwtjo ];
221− platforms = platforms.linux;
222223 };
223224 });
224225
@@ -228,14 +229,13 @@ let
228229 product = "WebStorm";
229230 meta = with lib; {
230231 homepage = "https://www.jetbrains.com/webstorm/";
231− inherit description license;
232+ inherit description license platforms;
232233 longDescription = ''
233234 WebStorm provides an editor for HTML, JavaScript (incl. Node.js),
234235 and CSS with on-the-fly code analysis, error prevention and
235236 automated refactorings for JavaScript code.
236237 '';
237238 maintainers = with maintainers; [ abaldeau ];
238− platforms = platforms.linux;
239239 };
240240 }).overrideAttrs (attrs: {
241241 postPatch = (attrs.postPatch or "") + optionalString (stdenv.isLinux) ''
@@ -244,6 +244,7 @@ let
244244 rm -r jbr
245245 '';
246246 });
247+
247248in
248249
249250{
@@ -251,12 +252,12 @@ in
251252
252253 clion = buildClion rec {
253254 name = "clion-${version}";
254− version = "2021.3.3"; /* updated by script */
255+ version = products.clion.version;
255256 description = "C/C++ IDE. New. Intelligent. Cross-platform";
256257 license = lib.licenses.unfree;
257258 src = fetchurl {
258− url = "https://download.jetbrains.com/cpp/CLion-${version}.tar.gz";
259− sha256 = "03gil00srq3jljc13iyb7v1yc6l6yhdhqm9d1ld2j2pympl6p61m"; /* updated by script */
259+ url = products.clion.url;
260+ sha256 = products.clion.sha256;
260261 };
261262 wmClass = "jetbrains-clion";
262263 update-channel = "CLion RELEASE"; # channel's id as in http://www.jetbrains.com/updates/updates.xml
@@ -264,12 +265,12 @@ in
264265
265266 datagrip = buildDataGrip rec {
266267 name = "datagrip-${version}";
267− version = "2021.3.4"; /* updated by script */
268+ version = products.datagrip.version;
268269 description = "Your Swiss Army Knife for Databases and SQL";
269270 license = lib.licenses.unfree;
270271 src = fetchurl {
271− url = "https://download.jetbrains.com/datagrip/${name}.tar.gz";
272− sha256 = "09dkxj5vn99gkgc1yd18w7gqkw2vzci0z9q2fcih0zn7lvqp0im3"; /* updated by script */
272+ url = products.datagrip.url;
273+ sha256 = products.datagrip.sha256;
273274 };
274275 wmClass = "jetbrains-datagrip";
275276 update-channel = "DataGrip RELEASE";
@@ -277,12 +278,12 @@ in
277278
278279 goland = buildGoland rec {
279280 name = "goland-${version}";
280− version = "2021.3.3"; /* updated by script */
281+ version = products.goland.version;
281282 description = "Up and Coming Go IDE";
282283 license = lib.licenses.unfree;
283284 src = fetchurl {
284− url = "https://download.jetbrains.com/go/${name}.tar.gz";
285− sha256 = "18z4mvxhds5fgdwcfywc4pj8s9ifvsknhradgzmxsvji0fbp0awx"; /* updated by script */
285+ url = products.goland.url;
286+ sha256 = products.goland.sha256;
286287 };
287288 wmClass = "jetbrains-goland";
288289 update-channel = "GoLand RELEASE";
@@ -290,12 +291,13 @@ in
290291
291292 idea-community = buildIdea rec {
292293 name = "idea-community-${version}";
293− version = "2021.3.2"; /* updated by script */
294+ product = "IntelliJ IDEA CE";
295+ version = products.idea-community.version;
294296 description = "Integrated Development Environment (IDE) by Jetbrains, community edition";
295297 license = lib.licenses.asl20;
296298 src = fetchurl {
297− url = "https://download.jetbrains.com/idea/ideaIC-${version}.tar.gz";
298− sha256 = "1j889b2r950bl9wiqq1z8v8s2qicidfcdar300cy666i8rc25qlr"; /* updated by script */
299+ url = products.idea-community.url;
300+ sha256 = products.idea-community.sha256;
299301 };
300302 wmClass = "jetbrains-idea-ce";
301303 update-channel = "IntelliJ IDEA RELEASE";
@@ -303,12 +305,13 @@ in
303305
304306 idea-ultimate = buildIdea rec {
305307 name = "idea-ultimate-${version}";
306− version = "2021.3.2"; /* updated by script */
308+ product = "IntelliJ IDEA";
309+ version = products.idea-ultimate.version;
307310 description = "Integrated Development Environment (IDE) by Jetbrains, requires paid license";
308311 license = lib.licenses.unfree;
309312 src = fetchurl {
310− url = "https://download.jetbrains.com/idea/ideaIU-${version}-no-jbr.tar.gz";
311− sha256 = "0w36qnqgkvw6j1ks09h515237bhqfaixrimzg2r494ic98amvkps"; /* updated by script */
313+ url = products.idea-ultimate.url;
314+ sha256 = products.idea-ultimate.sha256;
312315 };
313316 wmClass = "jetbrains-idea";
314317 update-channel = "IntelliJ IDEA RELEASE";
@@ -316,13 +319,13 @@ in
316319
317320 mps = buildMps rec {
318321 name = "mps-${version}";
319− version = "2021.3"; /* updated by script */
320− versionMajorMinor = "2021.3"; /* updated by script */
322+ product = "MPS ${products.mps.version-major-minor}";
323+ version = products.mps.version;
321324 description = "Create your own domain-specific language";
322325 license = lib.licenses.asl20;
323326 src = fetchurl {
324− url = "https://download.jetbrains.com/mps/${versionMajorMinor}/MPS-${version}.tar.gz";
325− sha256 = "0zw5xqdlhjfg0smfjl8xy7drf9spiwqbmqq8z22x4zb61lpvdbp9"; /* updated by script */
327+ url = products.mps.url;
328+ sha256 = products.mps.sha256;
326329 };
327330 wmClass = "jetbrains-mps";
328331 update-channel = "MPS RELEASE";
@@ -330,12 +333,12 @@ in
330333
331334 phpstorm = buildPhpStorm rec {
332335 name = "phpstorm-${version}";
333− version = "2021.3.2"; /* updated by script */
336+ version = products.phpstorm.version;
334337 description = "Professional IDE for Web and PHP developers";
335338 license = lib.licenses.unfree;
336339 src = fetchurl {
337− url = "https://download.jetbrains.com/webide/PhpStorm-${version}.tar.gz";
338− sha256 = "1qi0zq3gzcfnikky37g2dqgmzm7r1883k6asris8nph389qk86vn"; /* updated by script */
340+ url = products.phpstorm.url;
341+ sha256 = products.phpstorm.sha256;
339342 };
340343 wmClass = "jetbrains-phpstorm";
341344 update-channel = "PhpStorm RELEASE";
@@ -343,12 +346,13 @@ in
343346
344347 pycharm-community = buildPycharm rec {
345348 name = "pycharm-community-${version}";
346− version = "2021.3.2"; /* updated by script */
349+ product = "PyCharm CE";
350+ version = products.pycharm-community.version;
347351 description = "PyCharm Community Edition";
348352 license = lib.licenses.asl20;
349353 src = fetchurl {
350− url = "https://download.jetbrains.com/python/${name}.tar.gz";
351− sha256 = "1s36basydp7cxgbgdapjhkslx0x9vv3639xhm84ny76hf7s03bpi"; /* updated by script */
354+ url = products.pycharm-community.url;
355+ sha256 = products.pycharm-community.sha256;
352356 };
353357 wmClass = "jetbrains-pycharm-ce";
354358 update-channel = "PyCharm RELEASE";
@@ -356,12 +360,13 @@ in
356360
357361 pycharm-professional = buildPycharm rec {
358362 name = "pycharm-professional-${version}";
359− version = "2021.3.2"; /* updated by script */
363+ product = "PyCharm";
364+ version = products.pycharm-professional.version;
360365 description = "PyCharm Professional Edition";
361366 license = lib.licenses.unfree;
362367 src = fetchurl {
363− url = "https://download.jetbrains.com/python/${name}.tar.gz";
364− sha256 = "0rwykngqgby05mh47kls8wzi68gfka2z04k6kdmsxwn1hhx5gnbb"; /* updated by script */
368+ url = products.pycharm-professional.url;
369+ sha256 = products.pycharm-professional.sha256;
365370 };
366371 wmClass = "jetbrains-pycharm";
367372 update-channel = "PyCharm RELEASE";
@@ -369,12 +374,12 @@ in
369374
370375 rider = buildRider rec {
371376 name = "rider-${version}";
372− version = "2021.3.3"; /* updated by script */
377+ version = products.rider.version;
373378 description = "A cross-platform .NET IDE based on the IntelliJ platform and ReSharper";
374379 license = lib.licenses.unfree;
375380 src = fetchurl {
376− url = "https://download.jetbrains.com/rider/JetBrains.Rider-${version}.tar.gz";
377− sha256 = "13q6hk5l3fqmz818z5wj014jd5iglpdcpi8zlpgaim1jg5fpvi8x"; /* updated by script */
381+ url = products.rider.url;
382+ sha256 = products.rider.sha256;
378383 };
379384 wmClass = "jetbrains-rider";
380385 update-channel = "Rider RELEASE";
@@ -382,12 +387,12 @@ in
382387
383388 ruby-mine = buildRubyMine rec {
384389 name = "ruby-mine-${version}";
385− version = "2021.3.2"; /* updated by script */
390+ version = products.ruby-mine.version;
386391 description = "The Most Intelligent Ruby and Rails IDE";
387392 license = lib.licenses.unfree;
388393 src = fetchurl {
389− url = "https://download.jetbrains.com/ruby/RubyMine-${version}.tar.gz";
390− sha256 = "18ny40zl9hgkynkc5yyy2xqngl9diifh2gqrfnz7rfq14kp10xb9"; /* updated by script */
394+ url = products.ruby-mine.url;
395+ sha256 = products.ruby-mine.sha256;
391396 };
392397 wmClass = "jetbrains-rubymine";
393398 update-channel = "RubyMine RELEASE";
@@ -395,12 +400,12 @@ in
395400
396401 webstorm = buildWebStorm rec {
397402 name = "webstorm-${version}";
398− version = "2021.3.2"; /* updated by script */
403+ version = products.webstorm.version;
399404 description = "Professional IDE for Web and JavaScript development";
400405 license = lib.licenses.unfree;
401406 src = fetchurl {
402− url = "https://download.jetbrains.com/webstorm/WebStorm-${version}.tar.gz";
403− sha256 = "0q2hn48499hv7licpl84ly0bhiizya8a69dl2vjvgscj3cdkr98q"; /* updated by script */
407+ url = products.webstorm.url;
408+ sha256 = products.webstorm.sha256;
404409 };
405410 wmClass = "jetbrains-webstorm";
406411 update-channel = "WebStorm RELEASE";