From f8540d0e372cdf545ef4cded07ceb0a28350e19b Mon Sep 17 00:00:00 2001 From: Zynh Ludwig Date: Mon, 22 Jul 2024 00:48:31 -0700 Subject: [PATCH] neovim: no longer mangle init --- home/modules/neovim.nix | 48 ++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/home/modules/neovim.nix b/home/modules/neovim.nix index b3d1ae5..849fe0b 100644 --- a/home/modules/neovim.nix +++ b/home/modules/neovim.nix @@ -20,24 +20,28 @@ in # description = "The package to use for the neovim binary."; # }; }; - config = lib.mkIf cfg.enable { - # Set nvim as manpager and default editor - home.sessionVariables = { - EDITOR = "nvim"; - MANPAGER = "nvim +Man!"; - }; + config = + let + nvim-treesitter = pkgs.vimPlugins.nvim-treesitter; + treesitterWithGrammars = nvim-treesitter.withPlugins (_: nvim-treesitter.allGrammars); - programs.neovim = - let - nvim-treesitter = pkgs.vimPlugins.nvim-treesitter; - treesitterWithGrammars = nvim-treesitter.withPlugins (_: nvim-treesitter.allGrammars); + treesitter-parsers = pkgs.symlinkJoin { + name = "treesitter-parsers"; + paths = treesitterWithGrammars.dependencies; + }; + in + lib.mkIf cfg.enable { + # Set nvim as manpager and default editor + home.sessionVariables = { + EDITOR = "nvim"; + MANPAGER = "nvim +Man!"; + }; - treesitter-parsers = pkgs.symlinkJoin { - name = "treesitter-parsers"; - paths = treesitterWithGrammars.dependencies; - }; - in - { + xdg.configFile."nvim/lua/parsers.lua".text = '' + vim.opt.runtimepath:append ("${treesitter-parsers}") + ''; + + programs.neovim = { enable = true; coc.enable = false; package = cfg.package; @@ -45,16 +49,6 @@ in withPython3 = true; withRuby = true; - # TODO: nvim config nix import - extraLuaConfig = '' - -- bootstrap lazy.nvim, LazyVim and your plugins - require("config.lazy") - - vim.g.editorconfig = true - - vim.opt.runtimepath:append ("${treesitter-parsers}") - ''; - plugins = [ treesitterWithGrammars ]; @@ -67,5 +61,5 @@ in fzf ]; }; - }; + }; }