From 84f925e9c255373fb21d92bfff5aa7b526417d10 Mon Sep 17 00:00:00 2001 From: Snoweuph Date: Sat, 11 Apr 2026 12:36:34 +0200 Subject: [PATCH] lsp/presets/zls: init --- modules/plugins/lsp/presets/default.nix | 1 + modules/plugins/lsp/presets/zls.nix | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 modules/plugins/lsp/presets/zls.nix diff --git a/modules/plugins/lsp/presets/default.nix b/modules/plugins/lsp/presets/default.nix index 36044453..1e2b6e09 100644 --- a/modules/plugins/lsp/presets/default.nix +++ b/modules/plugins/lsp/presets/default.nix @@ -10,5 +10,6 @@ ./vala-language-server.nix ./wgsl-analyzer.nix ./yaml-language-server.nix + ./zls.nix ]; } diff --git a/modules/plugins/lsp/presets/zls.nix b/modules/plugins/lsp/presets/zls.nix new file mode 100644 index 00000000..9d540928 --- /dev/null +++ b/modules/plugins/lsp/presets/zls.nix @@ -0,0 +1,25 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (lib.meta) getExe; + inherit (lib.modules) mkIf; + inherit (lib.options) mkEnableOption; + + cfg = config.vim.lsp.presets.zls; +in { + options.vim.lsp.presets.zls = { + enable = mkEnableOption "the Zig Language Server"; + }; + + config = mkIf cfg.enable { + vim.lsp.servers.zls = { + enable = true; + cmd = [(getExe pkgs.zls)]; + root_markers = [".git" "zls.json"]; + workspace_required = false; + }; + }; +}