about summary refs log tree commit diff
path: root/pkgs/development/tools/tabnine
diff options
context:
space:
mode:
authorAndrey Kuznetsov <fear@loathing.in>2021-10-16 19:19:51 +0400
committerAndrey Kuznetsov <fear@loathing.in>2021-10-16 22:34:06 +0400
commit906449e547dba65e57dc9762e6bebdd23c6f8744 (patch)
tree635c54c9688d41abd1c34ea21a69644729073a03 /pkgs/development/tools/tabnine
parentc4c85b5764e9276288b439f8cee86021ac011e8d (diff)
tabnine: support aarch64-darwin
Diffstat (limited to 'pkgs/development/tools/tabnine')
-rw-r--r--pkgs/development/tools/tabnine/default.nix21
1 files changed, 16 insertions, 5 deletions
diff --git a/pkgs/development/tools/tabnine/default.nix b/pkgs/development/tools/tabnine/default.nix
index 2a4d1718a790e..960ef3d533b3a 100644
--- a/pkgs/development/tools/tabnine/default.nix
+++ b/pkgs/development/tools/tabnine/default.nix
@@ -1,13 +1,24 @@
 { stdenv, lib, fetchurl, unzip }:
 let
-  platform =
-    if stdenv.hostPlatform.system == "x86_64-linux" then {
+  supportedPlatforms = {
+    "x86_64-linux" = {
       name = "x86_64-unknown-linux-musl";
       sha256 = "sha256-+jxjHE2/6IGptMlKXGebHcaIVokOP76ut325EbkdaA0=";
-    } else if stdenv.hostPlatform.system == "x86_64-darwin" then {
+    };
+    "x86_64-darwin" = {
       name = "x86_64-apple-darwin";
       sha256 = "sha256-87Hy1akNrZWQbKutkv4CToTyMcxRc7Y24o1+vI4pev8=";
-    } else throw "Not supported on ${stdenv.hostPlatform.system}";
+    };
+    "aarch64-darwin" = {
+      name = "aarch64-apple-darwin";
+      sha256 = "sha256-BEq+kma38Ltok/HybgcO+OTVgfgIHb5magmu7ILSvgU=";
+    };
+  };
+  platform =
+    if (builtins.hasAttr stdenv.hostPlatform.system supportedPlatforms) then
+      builtins.getAttr (stdenv.hostPlatform.system) supportedPlatforms
+    else
+      throw "Not supported on ${stdenv.hostPlatform.system}";
 in
 stdenv.mkDerivation rec {
   pname = "tabnine";
@@ -42,7 +53,7 @@ stdenv.mkDerivation rec {
     homepage = "https://tabnine.com";
     description = "Smart Compose for code that uses deep learning to help you write code faster";
     license = licenses.unfree;
-    platforms = [ "x86_64-darwin" "x86_64-linux" ];
+    platforms = [ "x86_64-darwin" "aarch64-darwin" "x86_64-linux" ];
     maintainers = with maintainers; [ lovesegfault ];
   };
 }