From 3b5a73c436eb22e0cda59469263490705e149cb9 Mon Sep 17 00:00:00 2001 From: schererleander Date: Fri, 9 Jan 2026 16:57:15 +0100 Subject: refactor: use flake-parts, change modules structure --- modules/home/editors/neovim/default.nix | 114 ++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 modules/home/editors/neovim/default.nix (limited to 'modules/home/editors/neovim/default.nix') diff --git a/modules/home/editors/neovim/default.nix b/modules/home/editors/neovim/default.nix new file mode 100644 index 0000000..c9d30db --- /dev/null +++ b/modules/home/editors/neovim/default.nix @@ -0,0 +1,114 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + inherit (lib) + mkOption + types + mkIf + optionals + ; + cfg = config.nx.editors.neovim; +in +{ + options.nx.editors.neovim = { + enable = mkOption { + description = "Neovim editor"; + type = types.bool; + default = true; + }; + + langs = { + python = mkOption { + description = "enable the python integration"; + type = types.bool; + default = false; + }; + go = mkOption { + description = "enable go integration"; + type = types.bool; + default = false; + }; + ts = mkOption { + description = "enable the js/ts integration"; + type = types.bool; + default = false; + }; + nix = mkOption { + description = "enable the nix integration"; + type = types.bool; + default = true; + }; + lua = mkOption { + description = "enable the lua integration"; + type = types.bool; + default = true; + }; + latex = mkOption { + description = "enable latex integration"; + type = types.bool; + default = false; + }; + typst = mkOption { + description = "enable typst integration"; + type = types.bool; + default = false; + }; + }; + }; + + config = mkIf cfg.enable { + programs.neovim = { + defaultEditor = true; + enable = true; + package = pkgs.neovim-unwrapped; + extraPackages = + with pkgs; + [ + tree-sitter + git + ripgrep + fd + gcc + ] + ++ (optionals cfg.langs.ts [ pkgs.nodePackages.typescript-language-server ]) + ++ (optionals cfg.langs.python [ ]) + ++ (optionals cfg.langs.go [ pkgs.gopls ]) + ++ (optionals cfg.langs.nix [ + pkgs.nil + pkgs.nixfmt + ]) + ++ (optionals cfg.langs.lua [ pkgs.lua-language-server ]) + ++ (optionals cfg.langs.latex [ pkgs.texlab ]) + ++ (optionals cfg.langs.typst [ pkgs.tinymist ]); + + plugins = with pkgs.vimPlugins; [ + gruvbox-nvim + mini-starter + gitsigns-nvim + nvim-autopairs + telescope-nvim + fidget-nvim + plenary-nvim + nvim-treesitter.withAllGrammars + nvim-lspconfig + nvim-cmp + cmp-nvim-lsp + cmp-buffer + cmp-path + cmp-cmdline + luasnip + cmp_luasnip + lspkind-nvim + ]; + + extraConfig = '' + luafile ${./init.lua} + ''; + }; + }; +} -- cgit v1.3.1