mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
modules/dependencies: add llm-ls
This commit is contained in:
parent
75d2125e01
commit
0a78c93e7a
3 changed files with 27 additions and 14 deletions
|
@ -30,6 +30,7 @@ let
|
|||
lazygit.default = "lazygit";
|
||||
lean.default = "lean4";
|
||||
ledger.default = "ledger";
|
||||
llm-ls.default = "llm-ls";
|
||||
manix.default = "manix";
|
||||
nodejs = {
|
||||
default = "nodejs";
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
{ lib, pkgs, ... }:
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
lib.nixvim.plugins.mkNeovimPlugin {
|
||||
name = "llm";
|
||||
packPathName = "llm.nvim";
|
||||
|
@ -6,17 +10,25 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
|
||||
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||
|
||||
extraOptions = {
|
||||
llmLsPackage = lib.mkPackageOption pkgs "llm-ls" {
|
||||
nullable = true;
|
||||
};
|
||||
};
|
||||
extraConfig = cfg: {
|
||||
extraPackages = [ cfg.llmLsPackage ];
|
||||
imports = [
|
||||
# TODO: added 2025-04-07, remove after 25.05
|
||||
(lib.nixvim.mkRemovedPackageOptionModule {
|
||||
plugin = "llm";
|
||||
packageName = "llm-ls";
|
||||
oldPackageName = "llmLs";
|
||||
})
|
||||
];
|
||||
|
||||
extraConfig =
|
||||
let
|
||||
llm-ls-dep = config.dependencies.llm-ls;
|
||||
in
|
||||
{
|
||||
dependencies.llm-ls.enable = lib.mkDefault true;
|
||||
|
||||
# If not setting this option, llm.nvim will try to download the llm-ls binary from the internet.
|
||||
plugins.llm.settings.lsp.bin_path = lib.mkIf (cfg.llmLsPackage != null) (
|
||||
lib.mkDefault (lib.getExe cfg.llmLsPackage)
|
||||
plugins.llm.settings.lsp.bin_path = lib.mkIf llm-ls-dep.enable (
|
||||
lib.mkDefault (lib.getExe llm-ls-dep.package)
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
plugins.llm = {
|
||||
enable = true;
|
||||
|
||||
llmLsPackage = null;
|
||||
settings.lsp.bin_path = null;
|
||||
};
|
||||
dependencies.llm-ls.enable = false;
|
||||
};
|
||||
|
||||
defaults = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue