summary refs log tree commit diff stats
path: root/user/settings/tabnine.nix
blob: d343211c568a459ad0d01093ac0acb2a4c6954f2 (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
{ pkgs, ... }:

let
  inherit (pkgs) stdenv;

  version = "2.8.9";
  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";
      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";
      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" ];
      };
      "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 = (pkgs.fetchurl {
      url = "https://update.tabnine.com/${version}/${target}/TabNine";
      sha256 = if stdenv.isDarwin then
        "11a909iwwbw3mbylxsik9dmnkn5nfblygldcw1bgpir47kr3a20p"
      else
        "1d66bf6xq1hwd0jb2xzj73j375vm4yj3icq1bbamal0b9380a3jk";
    });
  };
}