From c583914eee8959cf2f416bb672ae8d50e19c7e13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20=22Capypara=22=20K=C3=B6pcke?= Date: Sun, 21 Dec 2025 15:29:38 +0100 Subject: [PATCH] jetbrains.*-oss: Add fallback URLs w/o the cache redirector Co-Authored-By: Matt Sturgeon --- .../editors/jetbrains/source/build.nix | 43 +++++++++++-------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/pkgs/applications/editors/jetbrains/source/build.nix b/pkgs/applications/editors/jetbrains/source/build.nix index 4fb2a2bf6b5a..ed8deca314cf 100644 --- a/pkgs/applications/editors/jetbrains/source/build.nix +++ b/pkgs/applications/editors/jetbrains/source/build.nix @@ -173,7 +173,12 @@ let mkRepoEntry = entry: { name = ".m2/repository/" + entry.path; path = fetchurl { - urls = map (url: "${url}/${entry.url}") repositories; + urls = lib.concatMap (url: [ + "https://cache-redirector.jetbrains.com/${url}/${entry.url}" + "https://${url}/${entry.url}" + ]) repositories; + # Do not try to retry 4xx errors + curlOptsList = [ "--no-retry-all-errors" ]; sha256 = entry.hash; }; }; @@ -181,25 +186,26 @@ let kotlin-jps-plugin-classpath = let - repoUrl = "https://packages.jetbrains.team/maven/p/ij/intellij-dependencies/org/jetbrains/kotlin/kotlin-jps-plugin-classpath"; - groupId = builtins.replaceStrings [ "." ] [ "/" ] "org.jetbrains.kotlin"; + repoBaseUrl = "packages.jetbrains.team/maven/p/ij/intellij-dependencies"; + repoUrls = [ + "https://cache-redirector.jetbrains.com/${repoBaseUrl}" + "https://${repoBaseUrl}" + ]; + groupId = "org/jetbrains/kotlin"; artefactId = "kotlin-jps-plugin-classpath"; version = kotlin-jps-plugin.version; in fetchurl { - url = - repoUrl - + "/" - + groupId - + "/" - + artefactId - + "/" - + version - + "/" - + artefactId - + "-" - + version - + ".jar"; + urls = map ( + url: + lib.concatStringsSep "/" [ + url + groupId + artefactId + version + "${artefactId}-${version}.jar" + ] + ) repoUrls; hash = kotlin-jps-plugin.hash; }; @@ -215,7 +221,10 @@ let "OpenSourceCommunityInstallersBuildTarget"; xplat-launcher = fetchzip { - url = "https://cache-redirector.jetbrains.com/intellij-dependencies/org/jetbrains/intellij/deps/launcher/242.22926/launcher-242.22926.tar.gz"; + urls = [ + "https://cache-redirector.jetbrains.com/intellij-dependencies/org/jetbrains/intellij/deps/launcher/242.22926/launcher-242.22926.tar.gz" + "https://packages.jetbrains.team/maven/p/ij/intellij-dependencies/org/jetbrains/intellij/deps/launcher/242.22926/launcher-242.22926.tar.gz" + ]; hash = "sha256-ttrQZUbBvvyH1BSVt1yWOoD82WwRi/hkoRfrsdCjwTA="; stripRoot = false; };