mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-27 11:08:53 +02:00
plugins/lsp/pylsp: Add python option to generate obtain the pylsp from.
Currently, pkgs.python3Packges is used by default and is unable to be changed. This stops consumers from using different/newer python versions.
This commit is contained in:
parent
100ae4027d
commit
079c2c479b
1 changed files with 479 additions and 472 deletions
|
@ -10,10 +10,16 @@ let
|
|||
cfg = config.plugins.lsp.servers.pylsp;
|
||||
in
|
||||
{
|
||||
options.plugins.lsp.servers.pylsp = {
|
||||
pythonPackage = mkOption {
|
||||
type = lib.types.package;
|
||||
description = "Python package to use for lsp.";
|
||||
default = pkgs.python3;
|
||||
};
|
||||
|
||||
# All settings are documented here:
|
||||
# https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md
|
||||
|
||||
options.plugins.lsp.servers.pylsp.settings = {
|
||||
settings = {
|
||||
configurationSources = mkOption {
|
||||
type = lib.types.nullOr (
|
||||
types.enum [
|
||||
|
@ -491,6 +497,7 @@ in
|
|||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# WARNING: tricky stuff below:
|
||||
|
@ -540,7 +547,7 @@ in
|
|||
))
|
||||
)
|
||||
(
|
||||
with pkgs.python3Packages;
|
||||
with cfg.pythonPackage.pkgs;
|
||||
{
|
||||
pylsp_mypy = pylsp-mypy.overridePythonAttrs (old: {
|
||||
postPatch =
|
||||
|
@ -598,7 +605,7 @@ in
|
|||
in
|
||||
mkDefault (
|
||||
# This is the final default package for pylsp
|
||||
pkgs.python3Packages.python-lsp-server.overridePythonAttrs (old: {
|
||||
cfg.pythonPackage.pkgs.python-lsp-server.overridePythonAttrs (old: {
|
||||
propagatedBuildInputs = pylspPlugins ++ old.dependencies;
|
||||
disabledTests = (old.disabledTests or [ ]) ++ [
|
||||
# Those tests fail when third-party plugins are loaded
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue