modules/dependencies: add llm-ls

This commit is contained in:
Gaetan Lepage 2025-04-07 23:24:09 +02:00 committed by nix-infra-bot
parent 75d2125e01
commit 0a78c93e7a
3 changed files with 27 additions and 14 deletions

View file

@ -30,6 +30,7 @@ let
lazygit.default = "lazygit"; lazygit.default = "lazygit";
lean.default = "lean4"; lean.default = "lean4";
ledger.default = "ledger"; ledger.default = "ledger";
llm-ls.default = "llm-ls";
manix.default = "manix"; manix.default = "manix";
nodejs = { nodejs = {
default = "nodejs"; default = "nodejs";

View file

@ -1,4 +1,8 @@
{ lib, pkgs, ... }: {
lib,
config,
...
}:
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "llm"; name = "llm";
packPathName = "llm.nvim"; packPathName = "llm.nvim";
@ -6,19 +10,27 @@ lib.nixvim.plugins.mkNeovimPlugin {
maintainers = [ lib.maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
extraOptions = { imports = [
llmLsPackage = lib.mkPackageOption pkgs "llm-ls" { # TODO: added 2025-04-07, remove after 25.05
nullable = true; (lib.nixvim.mkRemovedPackageOptionModule {
}; plugin = "llm";
}; packageName = "llm-ls";
extraConfig = cfg: { oldPackageName = "llmLs";
extraPackages = [ cfg.llmLsPackage ]; })
];
# If not setting this option, llm.nvim will try to download the llm-ls binary from the internet. extraConfig =
plugins.llm.settings.lsp.bin_path = lib.mkIf (cfg.llmLsPackage != null) ( let
lib.mkDefault (lib.getExe cfg.llmLsPackage) 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 llm-ls-dep.enable (
lib.mkDefault (lib.getExe llm-ls-dep.package)
);
};
settingsOptions = import ./settings-options.nix lib; settingsOptions = import ./settings-options.nix lib;

View file

@ -9,9 +9,9 @@
plugins.llm = { plugins.llm = {
enable = true; enable = true;
llmLsPackage = null;
settings.lsp.bin_path = null; settings.lsp.bin_path = null;
}; };
dependencies.llm-ls.enable = false;
}; };
defaults = { defaults = {