From 0e66f6282bd7579504a0ce8eb18c6bcc4af44c23 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Tue, 19 Sep 2023 01:40:56 +0200 Subject: [PATCH] feat: make svelte lsp install optional --- modules/languages/svelte.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/languages/svelte.nix b/modules/languages/svelte.nix index a300f05..33c0bf3 100644 --- a/modules/languages/svelte.nix +++ b/modules/languages/svelte.nix @@ -16,7 +16,11 @@ with builtins; let lspconfig.svelte.setup { capabilities = capabilities; on_attach = attach_keymaps, - cmd = { "${cfg.lsp.package}/bin/svelteserver", "--stdio" } + cmd = ${ + if isList cfg.lsp.package + then nvim.lua.expToLua cfg.lsp.package + else ''{"${cfg.lsp.package}/bin/svelteserver", "--stdio"}'' + } } ''; }; @@ -74,7 +78,7 @@ in { package = mkOption { description = "Svelte LSP server package"; - type = types.package; + type = with types; either package (listOf str); default = servers.${cfg.lsp.server}.package; }; };