summary refs log tree commit diff stats
path: root/user/settings/tabnine.nix
blob: cb5039385876ab1bd48a309f7118f530ae6801b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
{ config, pkgs, ... }:

let
  inherit (pkgs) stdenv;

  version = "3.2.28";
  target = if stdenv.isDarwin then
    "x86_64-apple-darwin"
  else
    "x86_64-unknown-linux-musl";

  tabninePackage = (pkgs.fetchurl {
    url = "https://update.tabnine.com/${version}/${target}/TabNine";
    sha256 = if stdenv.isDarwin then
    "174dsbdah99576g0g31402bdb02lfnq7sbac4i9g69alklbrghxd"
    else
    "0lh770gjxlgx01rb8qn079nf04qs3nirahzsld1ga5v3l16wqvqh";
  });
in {
  imports = [ ../modules/tabnine.nix ];
  programs.tabnine = {
    enable = true;
    config = {
      inherit version;

      hide_promotional_message = true;
      beta_enabled = "No";
      binary_update_interval_seconds = null;
      ignore_all_lsp = false;
      creation_time = "2020-04-23T10:42: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_certificate_domain = null;
      tabnine_cloud_host = null;
      tabnine_cloud_port = null;
      cloud_whitelist = [ ];
      api_key = null;
      api_key_service_level = null;
      api_base_url = null;
      local_enabled = "Yes";
      local_indexing = null;
      local_model_size = null;
      disable_local_when_using_battery = false;
      hide_deep_information_message = false;
      enable_power_saving_mode = false;
      enable_telemetry = false;
      generation = "0";
      rate_limit_interval_seconds = null;
      rate_limit_amount = null;
    };
    lspConfig = {
      "language.typescript" = {
        command = "typescript-language-server";
        args = [ "--stdio" ];
      };
      "language.javascript" = {
        command = "javascript-typescript-stdio";
        args = [ "--stdio" ];
      };
      "language.css" = {
        command = "css-languageserver";
        args = [ "--stdio" ];
      };
      "language.scss" = {
        command = "css-languageserver";
        args = [ "--stdio" ];
      };
      "language.html" = {
        command = "html-languageserver";
        args = [ "--stdio" ];
      };
      "language.dockerfile" = {
        command = "docker-langserver";
        args = [ "--stdio" ];
      };
      "language.yaml" = {
        command = "yaml-language-server";
        args = [ "--stdio" ];
      };
      "language.haskell" = {
        command = "hie";
        args = [ "--stdio" ];
      };
      "language.go" = {
        command = "go-langserver";
        args = [
          "-mode" "stdio"
          "-gocodecompletion"
        ];
      };
    };
  };

  home.file.".local/tabnine/${version}/${target}/TabNine" = {
    executable = true;
    source = tabninePackage;
  };
  programs.neovim.coc.config = {
    "tabnine.binary_path" = "${tabninePackage}";
  };
}