plugins/lsp: add packageFallback option
Some checks are pending
Publish every Git push to main to FlakeHub / flakehub-publish (push) Waiting to run
Publish every git push to Flakestry / publish-flake (push) Waiting to run
Documentation / Build unstable (push) Waiting to run
Documentation / Build 24.11 (push) Waiting to run
Documentation / Build 25.05 (push) Waiting to run
Documentation / Combine builds (push) Blocked by required conditions
Documentation / Deploy (push) Blocked by required conditions

https://github.com/nix-community/nixvim/pull/3445#pullrequestreview-2908615597
This commit is contained in:
sportshead 2025-06-08 23:30:08 +01:00 committed by Matt Sturgeon
parent ee715541ab
commit 6a054de04d
4 changed files with 77 additions and 6 deletions

View file

@ -55,6 +55,16 @@ in
lib.nixvim.mkMaybeUnpackagedOption "plugins.lsp.servers.${name}.package" pkgs name
package;
packageFallback = mkOption {
type = types.bool;
default = false;
description = ''
When enabled, the language server package will be added to the end of the `PATH` _(suffix)_ instead of the beginning _(prefix)_.
This can be useful if you want local versions of the language server (e.g. from a devshell) to override the nixvim version.
'';
};
cmd = mkOption {
type = with types; nullOr (listOf str);
default =
@ -148,7 +158,8 @@ in
};
config = lib.mkIf enabled {
extraPackages = [ cfg.package ];
extraPackages = lib.optional (!cfg.packageFallback) cfg.package;
extraPackagesAfter = lib.optional cfg.packageFallback cfg.package;
plugins.lsp.enabledServers = [
{