From 35e86d1f12058b617adc1f0c04dd18480c74cdb9 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Tue, 19 Sep 2023 01:26:29 +0200 Subject: [PATCH] feat: make sql lsp install optional --- modules/languages/sql.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/languages/sql.nix b/modules/languages/sql.nix index 4093ec91..0f1a4e91 100644 --- a/modules/languages/sql.nix +++ b/modules/languages/sql.nix @@ -20,7 +20,11 @@ with builtins; let on_attach_keymaps(client, bufnr) require'sqls'.setup{} end, - cmd = { "${cfg.lsp.package}/bin/sqls", "-config", string.format("%s/config.yml", vim.fn.getcwd()) } + cmd = ${ + if isList cfg.lsp.package + then nvim.lua.expToLua cfg.lsp.package + else ''{ "${cfg.lsp.package}/bin/sqls", "-config", string.format("%s/config.yml", vim.fn.getcwd()) }'' + } } ''; }; @@ -88,7 +92,7 @@ in { package = mkOption { description = "SQL LSP server package"; - type = types.package; + type = with types; either package (listOf str); default = servers.${cfg.lsp.server}.package; }; };