mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-19 08:48:44 +02:00
nvim-lsp: updated package options
This commit is contained in:
parent
b381c38113
commit
09934f3756
2 changed files with 24 additions and 37 deletions
|
@ -7,8 +7,8 @@
|
|||
, serverName ? name
|
||||
, package ? pkgs.${name}
|
||||
, extraPackages ? { }
|
||||
, cmd ? null
|
||||
, settings ? null
|
||||
, cmd ? (cfg: null)
|
||||
, settings ? (cfg: { })
|
||||
, extraOptions ? { }
|
||||
, ...
|
||||
}:
|
||||
|
@ -25,35 +25,26 @@
|
|||
type = types.nullOr types.package;
|
||||
};
|
||||
} else { };
|
||||
|
||||
extraPackagesOptions = mapAttrs'
|
||||
(name: defaultPackage: {
|
||||
name = "${name}Package";
|
||||
value = mkOption {
|
||||
default = defaultPackage;
|
||||
type = types.package;
|
||||
};
|
||||
})
|
||||
extraPackages;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
plugins.lsp.servers.${name} = {
|
||||
enable = mkEnableOption description;
|
||||
} // packageOption // extraPackagesOptions;
|
||||
} // packageOption // extraOptions;
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
extraPackages = (optional (package != null) cfg.package) ++
|
||||
(mapAttrsToList (name: _: cfg."${name}Package") extraPackages);
|
||||
config = mkIf cfg.enable
|
||||
{
|
||||
extraPackages = (optional (package != null) cfg.package) ++
|
||||
(mapAttrsToList (name: _: cfg."${name}Package") extraPackages);
|
||||
|
||||
plugins.lsp.enabledServers = [{
|
||||
name = serverName;
|
||||
extraOptions = {
|
||||
inherit cmd;
|
||||
settings = if settings != null then settings cfg else { };
|
||||
};
|
||||
}];
|
||||
};
|
||||
plugins.lsp.enabledServers = [{
|
||||
name = serverName;
|
||||
extraOptions = {
|
||||
cmd = cmd cfg;
|
||||
settings = settings cfg;
|
||||
};
|
||||
}];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue