From 2075211c185b50a65a1573f0d96a34491e631a41 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Fri, 15 Sep 2023 00:02:34 +0200 Subject: [PATCH] feat: make zig lsp install optional --- modules/languages/zig.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/languages/zig.nix b/modules/languages/zig.nix index f6c42d3..2f3bcec 100644 --- a/modules/languages/zig.nix +++ b/modules/languages/zig.nix @@ -21,7 +21,7 @@ in { package = mkOption { description = "ZLS package"; - type = types.package; + type = with types; either package (listOf str); default = pkgs.zls; }; @@ -44,7 +44,11 @@ in { lspconfig.zls.setup { capabilities = capabilities, on_attach=default_on_attach, - cmd = {"${cfg.lsp.package}/bin/zls"}, + cmd = ${ + if isList cfg.lsp.package + then nvim.lua.expToLua cfg.lsp.package + else ''{"${cfg.lsp.package}/bin/zls"}'' + }, settings = { ["zls"] = { zig_exe_path = "${cfg.lsp.zigPackage}/bin/zig",