From f39385b96bbfde6024bb918690dcfd4441832eec Mon Sep 17 00:00:00 2001 From: Samuel Kunst Date: Tue, 17 Oct 2023 16:42:52 +0200 Subject: [PATCH] feat(lsp): allow cmd to be null --- modules/lsp/lsp-config.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/lsp/lsp-config.nix b/modules/lsp/lsp-config.nix index 8bf5804..33164b7 100644 --- a/modules/lsp/lsp-config.nix +++ b/modules/lsp/lsp-config.nix @@ -23,7 +23,11 @@ with lib; let }; serverConfig = defaultConfig - // {inherit (value) cmd;} + // ( + if value.cmd == null + then {} + else {inherit (value) cmd;} + ) // value.extraOpts; in '' require('lspconfig')['${name}'].setup ${toLua serverConfig} @@ -76,9 +80,13 @@ in { type = types.attrsOf (types.submodule { options = { cmd = mkOption { - type = types.listOf types.str; + type = types.nullOr (types.listOf types.str); + default = null; description = lib.mdDoc '' The command used to start the language server. Each `argv` should be a separate list entry. + + If you want to use the default lspconfig 'cmd' value, set this + value to null (this is the default). ''; example = lib.literalExpression '' cmd = [ "''${pkgs.myLanguageServer}/bin/my-lsp" "--stdio"];