From 54f52bec2ba6d4991421325cee94c18d0b0e0f14 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Tue, 19 Sep 2023 00:50:49 +0200 Subject: [PATCH] feat: make python lsp install optional --- modules/languages/python.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/languages/python.nix b/modules/languages/python.nix index daea5b8..8c85c27 100644 --- a/modules/languages/python.nix +++ b/modules/languages/python.nix @@ -16,7 +16,11 @@ with builtins; let lspconfig.pyright.setup{ capabilities = capabilities; on_attach = default_on_attach; - cmd = {"${cfg.lsp.package}/bin/pyright-langserver", "--stdio"} + cmd = ${ + if isList cfg.lsp.package + then nvim.lua.expToLua cfg.lsp.package + else ''{"${cfg.lsp.package}/bin/pyright-langserver", "--stdio"}'' + } } ''; }; @@ -123,7 +127,7 @@ in { package = mkOption { description = "python LSP server package"; - type = types.package; + type = with types; either package (listOf string); default = servers.${cfg.lsp.server}.package; }; };