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 ]; }; - }; + }; }