mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-30 14:49:44 +02:00
modules/lsp/servers: move the *
server to its own module
Introduce a bespoke `global-server.nix` module. This is less DRY, but
much simpler.
The `lsp.servers."*"` options are different enough from the other
`lsp.servers.<name>` options that it is simpler to just declare them
separately.
Now that we have a dedicated `global-server.nix` module, we no longer
need to split the normal server module into `server.nix`+`server-base.nix`
This partially reverts f2e96b67a3
This commit is contained in:
parent
8b3107ad6f
commit
90eb4e681c
5 changed files with 98 additions and 82 deletions
|
@ -18,6 +18,8 @@ let
|
|||
in
|
||||
{
|
||||
options = {
|
||||
enable = lib.mkEnableOption displayName;
|
||||
|
||||
name = lib.mkOption {
|
||||
type = types.maybeRaw types.str;
|
||||
description = ''
|
||||
|
@ -51,11 +53,32 @@ in
|
|||
Alternatively, ${displayName} should be installed on your `$PATH`.
|
||||
'';
|
||||
};
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = with types; attrsOf anything;
|
||||
description = ''
|
||||
Configurations for ${displayName}. ${settings.extraDescription or ""}
|
||||
'';
|
||||
default = { };
|
||||
example =
|
||||
settings.example or {
|
||||
cmd = [
|
||||
"clangd"
|
||||
"--background-index"
|
||||
];
|
||||
root_markers = [
|
||||
"compile_commands.json"
|
||||
"compile_flags.txt"
|
||||
];
|
||||
filetypes = [
|
||||
"c"
|
||||
"cpp"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
(lib.modules.importApply ./server-base.nix {
|
||||
inherit displayName settings;
|
||||
})
|
||||
./server-renames.nix
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue