diff options
author | Alan Pearce | 2019-10-08 19:43:28 +0200 |
---|---|---|
committer | Alan Pearce | 2019-10-08 19:45:27 +0200 |
commit | e3a41fb740bd254ef63eeaee0c70a5d854fd0490 (patch) | |
tree | 178e21c46889c7935a103478e37ab0d00496b26c /user | |
parent | 4381adba4f542479b8863879e66cb9772bf833e2 (diff) | |
download | nixfiles-e3a41fb740bd254ef63eeaee0c70a5d854fd0490.tar.lz nixfiles-e3a41fb740bd254ef63eeaee0c70a5d854fd0490.tar.zst nixfiles-e3a41fb740bd254ef63eeaee0c70a5d854fd0490.zip |
Inline TabNine configuration
Diffstat (limited to 'user')
-rw-r--r-- | user/modules/tabnine.nix | 55 | ||||
-rw-r--r-- | user/tabnine/.config/TabNine/TabNine.toml | 36 |
2 files changed, 52 insertions, 39 deletions
diff --git a/user/modules/tabnine.nix b/user/modules/tabnine.nix index f07850ed..8018bcca 100644 --- a/user/modules/tabnine.nix +++ b/user/modules/tabnine.nix @@ -1,8 +1,57 @@ { config, pkgs, ... }: +let + cfg = { + config = { + "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"]; + }; + }; + }; + configFile = config: + pkgs.runCommand "TabNine.toml" + { + buildInputs = [ pkgs.remarshal ]; + preferLocalBuild = true; + allowSubstitutes = false; + } + '' + remarshal -if json -of toml \ + < ${pkgs.writeText "config.json" (builtins.toJSON cfg.config)} \ + > $out + ''; +in { - xdg.configFile.TabNine = { - recursive = true; - source = ../tabnine/.config/TabNine; + xdg.configFile."TabNine/TabNine.toml" = { + source = configFile cfg.config; }; } diff --git a/user/tabnine/.config/TabNine/TabNine.toml b/user/tabnine/.config/TabNine/TabNine.toml deleted file mode 100644 index c239f5a0..00000000 --- a/user/tabnine/.config/TabNine/TabNine.toml +++ /dev/null @@ -1,36 +0,0 @@ -[language.javascript] -command = "javascript-typescript-stdio" -args = [] -install = [["nix-env", "-iA", "nixos-unstable.nodePackages_10_x.javascript-typescript-langserver"]] - -[language.typescript] -command = "typescript-language-server" -args = ["--stdio"] -install = [["nix-env", "-iA", "nixos-unstable.nodePackages_10_x.typescript-language-server"]] - -[language.css] -command = "css-languageserver" -args = ["--stdio"] -install = [["nix-env", "-iA", "nixos-unstable.nodePackages_10_x.vscode-css-languageserver-bin"]] - -[language.scss] -command = "css-languageserver" -args = ["--stdio"] -install = [["nix-env", "-iA", "nixos-unstable.nodePackages_10_x.vscode-css-languageserver-bin"]] - -[language.html] -command = "html-languageserver" -args = ["--stdio"] -install = [["nix-env", "-iA", "nixos-unstable.nodePackages_10_x.vscode-html-languageserver-bin"]] - -[language.dockerfile] -command = "docker-langserver" -args = ["--stdio"] - -[language.yaml] -command = "yaml-language-server" -args = ["--stdio"] - -[language.haskell] -command = "hie" -args = ["--lsp"] |