From 668c72f6d05aec8d2c506a406b7df692aaa5eba1 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Fri, 29 Sep 2023 18:14:35 +0100 Subject: [PATCH] home-manager/editor/neovim: add enableLsp/enableTreeSitter --- home-manager/editor/neovim.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/home-manager/editor/neovim.nix b/home-manager/editor/neovim.nix index 162b69af..642f7d31 100644 --- a/home-manager/editor/neovim.nix +++ b/home-manager/editor/neovim.nix @@ -13,6 +13,12 @@ in enableIcons = lib.mkEnableOption "icons" // { default = config.home-manager.desktop.enable || config.home-manager.darwin.enable; }; + enableLsp = lib.mkEnableOption "LSP" // { + default = config.home-manager.dev.enable; + }; + enableTreeSitter = lib.mkEnableOption "TreeSitter" // { + default = config.home-manager.dev.enable; + }; }; config = lib.mkIf cfg.enable { @@ -429,7 +435,7 @@ in vim-sleuth vim-surround ] - ++ lib.optionals (devCfg.enable) [ + ++ lib.optionals cfg.enableLsp [ { plugin = nvim-lspconfig; config = @@ -502,6 +508,8 @@ in EOF ''; } + ] + ++ lib.optionals cfg.enableTreeSitter [ { plugin = nvim-treesitter.withAllGrammars; config = '' @@ -544,7 +552,7 @@ in } nvim-ts-autotag ] - ++ lib.optionals (cfg.enableIcons) [ + ++ lib.optionals cfg.enableIcons [ nvim-web-devicons ]; };