From 581d41b82efbd534eba36a7906078361ee6d3f85 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 9 Dec 2019 17:27:14 +0100 Subject: tabnine: add crude management of tabnine installation and config --- user/settings/tabnine.nix | 72 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 59 insertions(+), 13 deletions(-) (limited to 'user/settings/tabnine.nix') diff --git a/user/settings/tabnine.nix b/user/settings/tabnine.nix index 9fa586b0..6a9e88a0 100644 --- a/user/settings/tabnine.nix +++ b/user/settings/tabnine.nix @@ -1,44 +1,90 @@ -{ ... }: +{ pkgs, ... }: -{ - imports = [ - ../modules/tabnine.nix - ]; +let + inherit (pkgs) stdenv; + + version = "2.1.21"; + target = if stdenv.isDarwin then + "x86_64-apple-darwin" + else + "x86_64-unknown-linux-musl"; +in { + imports = [ ../modules/tabnine.nix ]; programs.tabnine = { enable = true; + config = { + inherit version; + + hide_promotional_message = true; + beta_enabled = "No"; + ignore_all_lsp = false; + creation_time = "2019-08-26T09:51:35.732522096Z"; + semantic_status = { + typescript = "Enabled"; + javascript = "Enabled"; + yaml = "Enabled"; + }; + disable_auto_update = true; + user_understands_that_enabling_tabnine_cloud_sends_code_to_tabnine_servers = + false; + hosted_deep_completions_enabled = "Disabled"; + tabnine_cloud_host = null; + tabnine_cloud_port = null; + cloud_whitelist = [ ]; + api_key = null; + api_key_service_level = null; + api_base_url = null; + local_enabled = "No"; + disable_local_when_using_battery = true; + hide_deep_information_message = false; + enable_power_saving_mode = false; + rate_limit_interval_seconds = null; + rate_limit_amount = null; + }; lspConfig = { "language.typescript" = { command = "typescript-language-server"; - args = ["--stdio"]; + args = [ "--stdio" ]; }; "language.javascript" = { command = "javascript-typescript-stdio"; - args = ["--stdio"]; + args = [ "--stdio" ]; }; "language.css" = { command = "css-languageserver"; - args = ["--stdio"]; + args = [ "--stdio" ]; }; "language.scss" = { command = "css-languageserver"; - args = ["--stdio"]; + args = [ "--stdio" ]; }; "language.html" = { command = "html-languageserver"; - args = ["--stdio"]; + args = [ "--stdio" ]; }; "language.dockerfile" = { command = "docker-langserver"; - args = ["--stdio"]; + args = [ "--stdio" ]; }; "language.yaml" = { command = "yaml-language-server"; - args = ["--stdio"]; + args = [ "--stdio" ]; }; "language.haskell" = { command = "hie"; - args = ["--stdio"]; + args = [ "--stdio" ]; }; }; }; + + home.file.".local/tabnine/${version}/${target}/TabNine" = { + executable = true; + source = (pkgs.fetchurl { + url = "https://update.tabnine.com/${version}/${target}/TabNine"; + sha256 = if stdenv.isDarwin then + "00kjin3d9fq7332b8nm4ylli007fqbph42h7mykmk4lssy9dy8mm" + else + "0926qag5p513hxljc7qwmyi32y2grlhfdiz899i0rxky8rkcwhqh"; + }); + }; } -- cgit 1.4.1