aboutsummaryrefslogtreecommitdiff
path: root/modules/users/editors/neovim/default.nix
diff options
context:
space:
mode:
authorLeander Scherer <leander@schererleander.de>2026-01-08 02:48:11 +0100
committerLeander Scherer <leander@schererleander.de>2026-01-08 19:08:12 +0100
commit6174f3650cf42aaf008012e828d5a1f8e2ce037f (patch)
tree9bbbd99680cd5adb56596a14734d4896bc6af733 /modules/users/editors/neovim/default.nix
parentc582c4d0675aada46fa196b7af1941ed753d055f (diff)
refactor(modules): separate nixos/home-manager modules, use standard option conventions
Diffstat (limited to 'modules/users/editors/neovim/default.nix')
-rw-r--r--modules/users/editors/neovim/default.nix109
1 files changed, 109 insertions, 0 deletions
diff --git a/modules/users/editors/neovim/default.nix b/modules/users/editors/neovim/default.nix
new file mode 100644
index 0000000..975fae8
--- /dev/null
+++ b/modules/users/editors/neovim/default.nix
@@ -0,0 +1,109 @@
+{
+ config,
+ username,
+ 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;
+ };
+ java = mkOption {
+ description = "enable the java integration";
+ type = types.bool;
+ default = false;
+ };
+ nix = mkOption {
+ description = "enable the nix integration";
+ type = types.bool;
+ default = true;
+ };
+ latex = mkOption {
+ description = "enable latex 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.java [ pkgs.jdt-language-server ])
+ ++ (optionals cfg.langs.nix [
+ pkgs.nil
+ pkgs.nixfmt-rfc-style
+ ])
+ ++ (optionals cfg.langs.latex [ pkgs.texlab ]);
+
+ 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}
+ '';
+ };
+ };
+}