tabnine: expose binary platform in passthru

This commit is contained in:
Bernardo Meurer 2021-08-13 15:12:21 -07:00
parent 196138ea6b
commit b5de556b34
No known key found for this signature in database
GPG Key ID: F4C0D53B8D14C246

View File

@ -1,27 +1,23 @@
{ stdenv, lib, fetchurl, unzip }:
let
# You can check the latest version with `curl -sS https://update.tabnine.com/bundles/version`
version = "3.5.37";
src =
if stdenv.hostPlatform.system == "x86_64-darwin" then
fetchurl
{
url = "https://update.tabnine.com/bundles/${version}/x86_64-apple-darwin/TabNine.zip";
sha256 = "sha256-Vxmhl4/bhRDeByGgkdSF8yEY5wI23WzT2iH1OFkEpck=";
}
else if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl
{
url = "https://update.tabnine.com/bundles/${version}/x86_64-unknown-linux-musl/TabNine.zip";
sha256 = "sha256-pttjlx7WWE3nog9L1APp8HN+a4ShhlBj5irHOaPgqHw=";
}
else throw "Not supported on ${stdenv.hostPlatform.system}";
platform =
if stdenv.hostPlatform.system == "x86_64-linux" then {
name = "x86_64-unknown-linux-musl";
sha256 = "sha256-pttjlx7WWE3nog9L1APp8HN+a4ShhlBj5irHOaPgqHw=";
} else if stdenv.hostPlatform.system == "x86_64-darwin" then {
name = "x86_64-apple-darwin";
sha256 = "sha256-Vxmhl4/bhRDeByGgkdSF8yEY5wI23WzT2iH1OFkEpck=";
} else throw "Not supported on ${stdenv.hostPlatform.system}";
in
stdenv.mkDerivation rec {
pname = "tabnine";
# You can check the latest version with `curl -sS https://update.tabnine.com/bundles/version`
version = "3.5.37";
inherit version src;
src = fetchurl {
url = "https://update.tabnine.com/bundles/${version}/${platform.name}/TabNine.zip";
inherit (platform) sha256;
};
dontBuild = true;
@ -40,6 +36,8 @@ stdenv.mkDerivation rec {
runHook postInstall
'';
passthru.platform = platform.name;
meta = with lib; {
homepage = "https://tabnine.com";
description = "Smart Compose for code that uses deep learning to help you write code faster";