about summary refs log tree commit diff
path: root/pkgs/development/tools/tabnine
diff options
context:
space:
mode:
authorBernardo Meurer <bernardo@meurer.org>2022-08-03 00:14:02 -0700
committerBernardo Meurer <bernardo@meurer.org>2022-08-03 00:21:25 -0700
commit61d213c3ff65fc5ffb751753d2ae58cf9c1e07f7 (patch)
tree3cf4a16bfd71fe1f7b503b13d2ee8d8fe630c716 /pkgs/development/tools/tabnine
parent1830dc8874d29cc43e5f3a6120c2be71edaea666 (diff)
tabnine: 4.4.40 -> 4.4.98
Diffstat (limited to 'pkgs/development/tools/tabnine')
-rw-r--r--pkgs/development/tools/tabnine/default.nix11
-rwxr-xr-xpkgs/development/tools/tabnine/fetch-latest.sh29
2 files changed, 35 insertions, 5 deletions
diff --git a/pkgs/development/tools/tabnine/default.nix b/pkgs/development/tools/tabnine/default.nix
index 49377bd001c6b..25ff528c6b9ae 100644
--- a/pkgs/development/tools/tabnine/default.nix
+++ b/pkgs/development/tools/tabnine/default.nix
@@ -1,19 +1,20 @@
 { stdenv, lib, fetchurl, unzip }:
 let
   # You can check the latest version with `curl -sS https://update.tabnine.com/bundles/version`
-  version = "4.4.40";
+  # There's a handy prefetch script in ./fetch-latest.sh
+  version = "4.4.98";
   supportedPlatforms = {
     "x86_64-linux" = {
       name = "x86_64-unknown-linux-musl";
-      sha256 = "sha256-goPPGU4oZWBD/C15rbbX5YMqua16A4MdLhBoC4JxaCI=";
+      hash = "sha256-AYgv/XrHjEOhtyx8QeOhssdsc/fssShZcA+15fFgI1g=";
     };
     "x86_64-darwin" = {
       name = "x86_64-apple-darwin";
-      sha256 = "sha256-CgYHQ91U6K3+kMyOSSia2B7IncR5u0eq9h3EZiBsRdU=";
+      hash = "sha256-XUd97ZUUb8XqMrlnSBER68fU3+58zpwKnzZ+i3dlWIs=";
     };
     "aarch64-darwin" = {
       name = "aarch64-apple-darwin";
-      sha256 = "sha256-JwX3TdKYmLQO3mWb15Ds/60VAAurGxqfJlMCQqy2pxg=";
+      hash = "sha256-L2r4fB4OtJJUvwnFP7zYAm8RLf8b7r6kDNGlwZRkLnw=";
     };
   };
   platform =
@@ -28,7 +29,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "https://update.tabnine.com/bundles/${version}/${platform.name}/TabNine.zip";
-    inherit (platform) sha256;
+    inherit (platform) hash;
   };
 
   dontBuild = true;
diff --git a/pkgs/development/tools/tabnine/fetch-latest.sh b/pkgs/development/tools/tabnine/fetch-latest.sh
new file mode 100755
index 0000000000000..240a55976640b
--- /dev/null
+++ b/pkgs/development/tools/tabnine/fetch-latest.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+function prefetch-sri() {
+    nix-prefetch-url "$1" 2>/dev/null | xargs nix hash to-sri --type sha256
+}
+
+declare -a PLATFORMS=(
+    x86_64-unknown-linux-musl
+    x86_64-apple-darwin
+    aarch64-apple-darwin
+)
+
+LATEST="$(curl -sS https://update.tabnine.com/bundles/version)"
+
+cat <<-EOF
+version = "${LATEST}";
+EOF
+
+for platform in "${PLATFORMS[@]}"; do
+    url="https://update.tabnine.com/bundles/${LATEST}/${platform}/TabNine.zip"
+    sha="$(prefetch-sri "$url")"
+    cat <<-EOF
+name = "${platform}";
+hash = "${sha}";
+
+EOF
+done