mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 10:21:31 +00:00
treewide: begin restructuring the module tree
This commit is contained in:
parent
e1835f6c46
commit
7c730a78e5
254 changed files with 749 additions and 664 deletions
35
modules/plugins/lsp/lspconfig/config.nix
Normal file
35
modules/plugins/lsp/lspconfig/config.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.attrsets) mapAttrs;
|
||||
inherit (lib.nvim.dag) entryAfter;
|
||||
|
||||
cfg = config.vim.lsp;
|
||||
in {
|
||||
config = mkIf cfg.lspconfig.enable (mkMerge [
|
||||
{
|
||||
vim = {
|
||||
lsp.enable = true;
|
||||
|
||||
startPlugins = ["nvim-lspconfig"];
|
||||
|
||||
luaConfigRC.lspconfig = entryAfter ["lsp-setup"] ''
|
||||
local lspconfig = require('lspconfig')
|
||||
|
||||
${
|
||||
optionalString config.vim.ui.borders.enable ''
|
||||
require('lspconfig.ui.windows').default_options.border = '${config.vim.ui.borders.globalStyle}'
|
||||
''
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
{
|
||||
vim.luaConfigRC = mapAttrs (_: v: (entryAfter ["lspconfig"] v)) cfg.lspconfig.sources;
|
||||
}
|
||||
]);
|
||||
}
|
6
modules/plugins/lsp/lspconfig/default.nix
Normal file
6
modules/plugins/lsp/lspconfig/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./lspconfig.nix
|
||||
];
|
||||
}
|
14
modules/plugins/lsp/lspconfig/lspconfig.nix
Normal file
14
modules/plugins/lsp/lspconfig/lspconfig.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) attrsOf str;
|
||||
in {
|
||||
options.vim.lsp.lspconfig = {
|
||||
enable = mkEnableOption "nvim-lspconfig, also enabled automatically";
|
||||
|
||||
sources = mkOption {
|
||||
description = "nvim-lspconfig sources";
|
||||
type = attrsOf str;
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue