diff --git a/extra.nix b/extra.nix index 55a2f6a..e80abaa 100644 --- a/extra.nix +++ b/extra.nix @@ -33,6 +33,7 @@ inputs: let nvimCodeActionMenu.enable = true; trouble.enable = true; lspSignature.enable = true; + elixir.enable = isMaximal; rust.enable = isMaximal; python = isMaximal; clang.enable = isMaximal; diff --git a/modules/lsp/config.nix b/modules/lsp/config.nix index 581556e..c1cb706 100644 --- a/modules/lsp/config.nix +++ b/modules/lsp/config.nix @@ -19,25 +19,20 @@ in { [ "nvim-lspconfig" "null-ls" - ( - if (config.vim.autocomplete.enable && (config.vim.autocomplete.type == "nvim-cmp")) - then "cmp-nvim-lsp" - else null - ) - ( - if cfg.sql - then "sqls-nvim" - else null - ) ] - ++ ( - if cfg.rust.enable - then [ - "crates-nvim" - "rust-tools" - ] - else [] - ); + ++ optionals (cfg.rust.enable) [ + "crates-nvim" + "rust-tools" + ] + ++ optionals (cfg.elixir.enable) [ + "elixir-ls" + ] + ++ optionals ((config.vim.autocomplete.enable) && (config.vim.autocomplete.type == "nvim-cmp")) [ + "cmp-nvim-lsp" + ] + ++ optionals (cfg.sql) [ + "sqls-nvim" + ]; vim.configRC.lsp = nvim.dag.entryAnywhere '' ${ @@ -346,6 +341,13 @@ in { cmd = { "${pkgs.nodePackages.typescript-language-server}/bin/typescript-language-server", "--stdio" } } ''} + + ${writeIf cfg.elixir.enable '' + lspconfig.elixirls.setup { + cmd = { "${pkgs.elixir-ls}/language_server.sh" }, + on_attach = on_attach + } + ''} ''; } ); diff --git a/modules/lsp/module.nix b/modules/lsp/module.nix index a6b95d9..87df9db 100644 --- a/modules/lsp/module.nix +++ b/modules/lsp/module.nix @@ -65,6 +65,10 @@ in { }; }; + elixir = { + enable = mkEnableOption "Elixir LSP"; + }; + sql = mkEnableOption "SQL Language LSP"; go = mkEnableOption "Go language LSP"; ts = mkEnableOption "TS language LSP";