mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
`"*"` is effectively a meta server, where shared config/defaults can be set. It shouldn't have options like `activate` or `package` which relate to "real" servers. Therefore, we'll use `server-base.nix` directly, instead of the full `server.nix` module.
55 lines
1.5 KiB
Nix
55 lines
1.5 KiB
Nix
# Usage: lib.importApply ./server-base.nix { /*args*/ }
|
|
{
|
|
displayName ? "the language server",
|
|
settings ? null,
|
|
}:
|
|
{ lib, ... }:
|
|
let
|
|
inherit (lib) types;
|
|
in
|
|
{
|
|
options = {
|
|
enable = lib.mkEnableOption displayName;
|
|
|
|
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"
|
|
];
|
|
};
|
|
};
|
|
|
|
# NOTE: we need a warnings option for `mkRenamedOptionModule` to warn about unexpected definitions
|
|
# This can be removed when all rename aliases are gone
|
|
warnings = lib.mkOption {
|
|
type = with types; listOf str;
|
|
description = "Warnings to propagate to nixvim's `warnings` option.";
|
|
default = [ ];
|
|
internal = true;
|
|
visible = false;
|
|
};
|
|
};
|
|
|
|
imports = [
|
|
# TODO: rename added 2025-04-30 (during the 25.05 cycle)
|
|
# The previous name `config` was introduced 2025-04-28 (during the 25.05 cycle)
|
|
# Because the previous name `config` never made it into a stable release,
|
|
# we could consider dropping this alias sooner than normal.
|
|
(lib.mkRenamedOptionModule [ "config" ] [ "settings" ])
|
|
];
|
|
}
|