From c52c7f314ccadcc2fcd91e28c8fd1b88f6d5ce0c Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 18 Oct 2024 17:07:46 +0200 Subject: refactor(modules): Move all system modules to `by-name` From now on all modules should be added to the new `by-name` directory. This should help remove the (superficial and utterly useless) distinction between `home-manager` and `NixOS` modules. --- modules/home/conf/nvim/plgs/lsp/default.nix | 29 --------- .../home/conf/nvim/plgs/lsp/keymaps/default.nix | 70 ---------------------- .../home/conf/nvim/plgs/lsp/servers/default.nix | 15 ----- .../conf/nvim/plgs/lsp/servers/servers/bashls.nix | 5 -- .../conf/nvim/plgs/lsp/servers/servers/ccls.nix | 5 -- .../conf/nvim/plgs/lsp/servers/servers/ltex.nix | 39 ------------ .../conf/nvim/plgs/lsp/servers/servers/lua-ls.nix | 8 --- .../conf/nvim/plgs/lsp/servers/servers/nil-ls.nix | 10 ---- .../nvim/plgs/lsp/servers/servers/openscad.nix | 17 ------ .../conf/nvim/plgs/lsp/servers/servers/pylyzer.nix | 12 ---- .../plgs/lsp/servers/servers/quick-lint-js.nix | 15 ----- .../nvim/plgs/lsp/servers/servers/ruff-lsp.nix | 10 ---- .../plgs/lsp/servers/servers/rust-analyzer.nix | 17 ------ .../conf/nvim/plgs/lsp/servers/servers/texlab.nix | 7 --- 14 files changed, 259 deletions(-) delete mode 100644 modules/home/conf/nvim/plgs/lsp/default.nix delete mode 100644 modules/home/conf/nvim/plgs/lsp/keymaps/default.nix delete mode 100644 modules/home/conf/nvim/plgs/lsp/servers/default.nix delete mode 100644 modules/home/conf/nvim/plgs/lsp/servers/servers/bashls.nix delete mode 100644 modules/home/conf/nvim/plgs/lsp/servers/servers/ccls.nix delete mode 100644 modules/home/conf/nvim/plgs/lsp/servers/servers/ltex.nix delete mode 100644 modules/home/conf/nvim/plgs/lsp/servers/servers/lua-ls.nix delete mode 100644 modules/home/conf/nvim/plgs/lsp/servers/servers/nil-ls.nix delete mode 100644 modules/home/conf/nvim/plgs/lsp/servers/servers/openscad.nix delete mode 100644 modules/home/conf/nvim/plgs/lsp/servers/servers/pylyzer.nix delete mode 100644 modules/home/conf/nvim/plgs/lsp/servers/servers/quick-lint-js.nix delete mode 100644 modules/home/conf/nvim/plgs/lsp/servers/servers/ruff-lsp.nix delete mode 100644 modules/home/conf/nvim/plgs/lsp/servers/servers/rust-analyzer.nix delete mode 100644 modules/home/conf/nvim/plgs/lsp/servers/servers/texlab.nix (limited to 'modules/home/conf/nvim/plgs/lsp') diff --git a/modules/home/conf/nvim/plgs/lsp/default.nix b/modules/home/conf/nvim/plgs/lsp/default.nix deleted file mode 100644 index b7c1e174..00000000 --- a/modules/home/conf/nvim/plgs/lsp/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{...}: { - imports = [ - ./keymaps - ./servers - ]; - programs.nixvim.plugins.lsp = { - enable = true; - onAttach = - "" - # + '' - # function(client, bufnr) - # -- Enable completion triggered by - # -- vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') - # end - # '' - ; - preConfig = '' - vim.diagnostic.config({ - underline = true, - -- virtual_text = true, - virtual_text = { - source = "always", -- Or "if_many" - }, - update_in_insert = true, - severity_sort = true, - }, nil); - ''; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/keymaps/default.nix b/modules/home/conf/nvim/plgs/lsp/keymaps/default.nix deleted file mode 100644 index b1276639..00000000 --- a/modules/home/conf/nvim/plgs/lsp/keymaps/default.nix +++ /dev/null @@ -1,70 +0,0 @@ -{...}: { - programs.nixvim = { - plugins.lsp.keymaps = { - diagnostic = { - "N" = { - action = "goto_prev"; - desc = "go to previous diagnostic message"; - }; - "T" = { - action = "goto_next"; - desc = "go to next diagnostic message"; - }; - "e" = { - action = "open_float"; - desc = "open float for the symbol"; - }; - "gq" = { - action = "setloclist"; - desc = "add buffer diagnostic to the location list (quick-fix)"; - }; - }; - lspBuf = { - "gD" = { - action = "declaration"; - desc = "[G]o to [d]eclaration"; - }; - "hi" = { - action = "hover"; - desc = "Display [h]over [i]nformation"; - }; - "sh" = { - action = "signature_help"; - desc = "Display [s]ignature [h]elp"; - }; - "wa" = { - action = "add_workspace_folder"; - desc = "[W]orkspace folder [a]dd"; - }; - "wr" = { - action = "remove_workspace_folder"; - desc = "[W]orkspace folder [r]emove"; - }; - "rn" = { - action = "rename"; - desc = "[R]e[n]ame the item under the cursor"; - }; - "ca" = { - action = "code_action"; - desc = "Open the [c]ode [a]ction menu"; - }; - }; - }; - keymaps = [ - { - key = "f"; - action.__raw = "function() vim.lsp.buf.format { async = true } end"; - options.desc = "[F]ormat the current buffer (asynchronously)"; - } - { - key = "wl"; - action.__raw = '' - function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end - ''; - options.desc = "[W]orkspace folders [l]ist"; - } - ]; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/default.nix b/modules/home/conf/nvim/plgs/lsp/servers/default.nix deleted file mode 100644 index 605046d4..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{...}: { - imports = [ - # ./servers/pylyzer.nix - ./servers/bashls.nix - ./servers/ccls.nix - ./servers/quick-lint-js.nix - ./servers/ltex.nix - ./servers/lua-ls.nix - ./servers/nil-ls.nix - ./servers/openscad.nix - ./servers/ruff-lsp.nix - ./servers/rust-analyzer.nix - ./servers/texlab.nix - ]; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/bashls.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/bashls.nix deleted file mode 100644 index 0577a335..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/bashls.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - bashls.enable = true; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/ccls.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/ccls.nix deleted file mode 100644 index 0698bcce..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/ccls.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - ccls.enable = true; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/ltex.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/ltex.nix deleted file mode 100644 index 3224bc41..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/ltex.nix +++ /dev/null @@ -1,39 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - ltex = let - filetypes = [ - "java" - "cpp" - "shell" - "bash" - - "bibtex" - "context" - "context.tex" - "latex" - "tex" - - "markdown" - "org" - "restructuredtext" - "rsweave" - - "git-commit" - "gitcommit" - - "mail" - ]; - in { - enable = true; - inherit filetypes; - settings = { - enabled = filetypes; - completionEnabled = false; - language = "en-CA"; - additionalRules = { - enablePickyRules = true; - }; - }; - }; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/lua-ls.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/lua-ls.nix deleted file mode 100644 index 4f20558c..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/lua-ls.nix +++ /dev/null @@ -1,8 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - lua_ls = { - enable = true; - settings.telemetry.enable = false; - }; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/nil-ls.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/nil-ls.nix deleted file mode 100644 index f0cccbdc..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/nil-ls.nix +++ /dev/null @@ -1,10 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - nil_ls = { - enable = true; - settings = { - formatting.command = ["alejandra"]; - }; - }; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/openscad.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/openscad.nix deleted file mode 100644 index a0221cc4..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/openscad.nix +++ /dev/null @@ -1,17 +0,0 @@ -{pkgs, ...}: { - programs.nixvim = { - extraConfigLuaPost = - /* - lua - */ - '' - require('lspconfig').openscad_lsp.setup{ - cmd = {"openscad-lsp", "--stdio", "--fmt-style", "WebKit"}, - } - ''; - extraPackages = with pkgs; [ - openscad-lsp - clang-tools # Need to satisfy `clang-format` (which is used by openscad-lsp) - ]; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/pylyzer.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/pylyzer.nix deleted file mode 100644 index b1042221..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/pylyzer.nix +++ /dev/null @@ -1,12 +0,0 @@ -{pkgs, ...}: { - programs.nixvim = { - extraConfigLuaPost = - /* - lua - */ - '' - require('lspconfig').pylyzer.setup{} - ''; - extraPackages = with pkgs; [pylyzer]; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/quick-lint-js.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/quick-lint-js.nix deleted file mode 100644 index 23c3054a..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/quick-lint-js.nix +++ /dev/null @@ -1,15 +0,0 @@ -{pkgs, ...}: { - programs.nixvim = { - extraConfigLuaPost = - /* - lua - */ - '' - require('lspconfig').quick_lint_js.setup{ - } - ''; - extraPackages = with pkgs; [ - quick-lint-js - ]; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/ruff-lsp.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/ruff-lsp.nix deleted file mode 100644 index 6fbdc998..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/ruff-lsp.nix +++ /dev/null @@ -1,10 +0,0 @@ -{pkgs, ...}: { - programs.nixvim = { - plugins.lsp.servers = { - ruff_lsp = { - enable = true; - }; - }; - extraPackages = with pkgs; [ruff]; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/rust-analyzer.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/rust-analyzer.nix deleted file mode 100644 index 5da61a71..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/rust-analyzer.nix +++ /dev/null @@ -1,17 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - rust_analyzer = { - enable = true; - settings = { - typing.autoClosingAngleBrackets.enable = true; - - # Check with `cargo clippy` instead of just `cargo check` - check.command = "clippy"; - }; - # NOTE: These should be provided by the devenv, to support nightly and - # such things <2023-11-25> - installCargo = false; - installRustc = false; - }; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/texlab.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/texlab.nix deleted file mode 100644 index 59af8d39..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/texlab.nix +++ /dev/null @@ -1,7 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - texlab = { - enable = true; - }; - }; -} -- cgit 1.4.1