From 5db06024d727b2ca11f03d3ea6153a7946d8f720 Mon Sep 17 00:00:00 2001 From: schererleander Date: Tue, 29 Apr 2025 20:41:52 +0200 Subject: move modules --- modules/neovim/default.nix | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 modules/neovim/default.nix (limited to 'modules/neovim/default.nix') diff --git a/modules/neovim/default.nix b/modules/neovim/default.nix new file mode 100644 index 0000000..415861a --- /dev/null +++ b/modules/neovim/default.nix @@ -0,0 +1,57 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.neovim; +in { + options.neovim.enable = lib.mkEnableOption "Enable and setup neovim"; + + config = lib.mkIf cfg.enable { + xdg.configFile."nvim/lua".source = pkgs.lib.mkForce ./lua; + + programs.neovim = { + enable = true; + vimAlias = true; + + extraPackages = with pkgs; [ + lua-language-server + ]; + + plugins = with pkgs.vimPlugins; [ + lazy-nvim + nvim-lspconfig + friendly-snippets + telescope-nvim + + (nvim-treesitter.withPlugins (plugins: with plugins; [ + tree-sitter-bash + tree-sitter-c + tree-sitter-json + tree-sitter-lua + tree-sitter-python + tree-sitter-nix + tree-sitter-vim + tree-sitter-vimdoc + tree-sitter-yaml + tree-sitter-markdown + tree-sitter-markdown_inline + ])) + ]; + + extraLuaConfig = '' + vim.g.mapleader = " " + vim.g.maplocalleader = "\\" + + require('options') + require('keymaps') + require('plugins') + require('autocmds') + ''; + }; + + home.sessionVariables = rec { + EDITOR = "nvim"; + GIT_EDITOR = EDITOR; + }; + }; +} + -- cgit v1.3.1