diff --git a/configs/nixvim/trovebelt/default.nix b/configs/nixvim/trovebelt/default.nix index 805a161e..2e4a2089 100644 --- a/configs/nixvim/trovebelt/default.nix +++ b/configs/nixvim/trovebelt/default.nix @@ -1,7 +1,13 @@ { config, lib, ... }: { + imports = [ ./modules ]; + config = { + nixvimConfigs.trovebelt.setups = { + lsp.enable = true; + }; + # Some general settings. globals = { mapleader = " "; diff --git a/configs/nixvim/trovebelt/modules/default.nix b/configs/nixvim/trovebelt/modules/default.nix new file mode 100644 index 00000000..845b0a37 --- /dev/null +++ b/configs/nixvim/trovebelt/modules/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./setups/lsp.nix + ]; +} diff --git a/configs/nixvim/trovebelt/modules/setups/lsp.nix b/configs/nixvim/trovebelt/modules/setups/lsp.nix new file mode 100644 index 00000000..003686f0 --- /dev/null +++ b/configs/nixvim/trovebelt/modules/setups/lsp.nix @@ -0,0 +1,71 @@ +{ config, lib, ... }: + +let + nixvimCfg = config.nixvimConfigs.trovebelt; + cfg = nixvimCfg.setups.lsp; +in +{ + options.nixvimConfigs.trovebelt.setups.lsp.enable = + lib.mkEnableOption "LSP setup alongside the preferred servers installation"; + + config = lib.mkIf cfg.enable { + plugins.lsp.enable = true; + + # Make all of the preferred language servers. + plugins.lsp.servers = + let + servers = [ + "ansiblels" # For Ansible. + "astro" # For Astro. + "beancount" # For Beancount. + "bashls" # For Bash. + "clangd" # For C/C++. + "clojure-lsp" # For Clojure. + "cmake" # For CMake. + "cssls" # For CSS. + "dagger" # For Dagger. + "dartls" # For Dart. + "denols" # For Deno. + "dhall-lsp-server" # For Dhall. + "dockerls" # For Dockerfiles. + "efm" # For whatever. + "elixirls" # For Elixir. + "elmls" # For Elm. + "emmet_ls" # For Emmet support. + "eslint" # For JavaScript. + "gdscript" # For Godot. + "gopls" # For Go. + "graphql" # For GraphQL. + "hls" # For Haskell. + "html" # For HTML. + "htmx" # For HTMX. + "java-language-server" # For Java. + "jsonls" # For JSON. + "julials" # For Julia. + "kotlin-language-server" # For Kotlin. + "lemminx" # For XML. + "lua-ls" # For Lua. + "nil_ls" # For Nix. + "nushell" # For Nushell. + "perlpls" # For Perl. + "phpactor" # For PHP. + "pyright" # For Python. + "rust-analyzer" # For Rust. + "solargraph" # For Ruby. + "svelte" # For Svelte. + "taplo" # For TOML. + "tailwindcss" # For Tailwind CSS. + "terraformls" # For Terraform. + "tsserver" # For TypeScript. + "typst-lsp" # For Typst. + "vls" # For V. + "volar" # For Vue. + "yamlls" # For YAML. + "zls" # For Zig. + ]; + + mkEnableServerConfig = server: lib.nameValuePair server { enable = true; }; + in + lib.listToAttrs (builtins.map mkEnableServerConfig servers); + }; +}