From dd400f5b24b56bc3d03fc3484d7f01bdb786fd9a Mon Sep 17 00:00:00 2001 From: Aditya Date: Thu, 11 Apr 2024 18:12:59 +0530 Subject: [PATCH] add neovim --- hosts/default/home.nix | 44 -------------------- modules/home-manager/default.nix | 2 + modules/home-manager/neovim/default.nix | 54 +++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 44 deletions(-) create mode 100644 modules/home-manager/neovim/default.nix diff --git a/hosts/default/home.nix b/hosts/default/home.nix index 59c8d92..391d0c8 100644 --- a/hosts/default/home.nix +++ b/hosts/default/home.nix @@ -106,50 +106,6 @@ "electron-25.9.0" ]; - programs.neovim = { - enable = false; - defaultEditor = true; - # coc.enable = true; - # extraLuaConfig = '' - # for _, source in ipairs { - # "astronvim.bootstrap", - # "astronvim.options", - # "astronvim.lazy", - # "astronvim.autocmds", - # "astronvim.mappings", - # } do - # local status_ok, fault = pcall(require, source) - # if not status_ok then vim.api.nvim_err_writeln("Failed to load " .. source .. "\n\n" .. fault - # ) end - # end - # - # if astronvim.default_colorscheme then - # if not pcall(vim.cmd.colorscheme, astronvim.default_colorscheme) then - # requrie("astronvim.utils").notify( - # "Error setting up colorscheme: " .. astronvim.default_colorscheme, - # vim.log.levels.ERROR - # ) - # end - # end - # - # require("astronvim.utils").conditional_func(astronvim.user_opts("polish", nil, false), true) - # ''; - # - # plugins = (with pkgs.vimPlugins; [ - # rust-vim - # rust-tools-nvim - # coc-rust-analyzer - # nvim-treesitter-parsers.rust - # nvim-treesitter-parsers.cpp - # nvim-treesitter-parsers.c - # nvim-treesitter-parsers.latex - # coc-rls - # coc-clangd - # clangd_extensions-nvim - # vim-clang-format - # ]); - }; - programs.vscode = { enable = true; extensions = with pkgs.vscode-extensions; [ diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 91d3d10..f6ba745 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -2,6 +2,7 @@ imports = [ ./bash ./kitty + ./neovim ./session-vars ./tmux ./zsh @@ -11,6 +12,7 @@ bash.enable = lib.mkDefault true; kitty.enable = lib.mkDefault true; + neovim.enable = lib.mkDefault true; tmux.enable = lib.mkDefault true; zsh.enable = lib.mkDefault true; } diff --git a/modules/home-manager/neovim/default.nix b/modules/home-manager/neovim/default.nix new file mode 100644 index 0000000..d786c06 --- /dev/null +++ b/modules/home-manager/neovim/default.nix @@ -0,0 +1,54 @@ +{ + config, + lib, + ... +}: { + options = { + neovim.enable = lib.mkEnableOption "enable neovim"; + }; + config = lib.mkIf config.neovim.enable { + programs.neovim = { + enable = false; + defaultEditor = true; + # coc.enable = true; + # extraLuaConfig = '' + # for _, source in ipairs { + # "astronvim.bootstrap", + # "astronvim.options", + # "astronvim.lazy", + # "astronvim.autocmds", + # "astronvim.mappings", + # } do + # local status_ok, fault = pcall(require, source) + # if not status_ok then vim.api.nvim_err_writeln("Failed to load " .. source .. "\n\n" .. fault + # ) end + # end + # + # if astronvim.default_colorscheme then + # if not pcall(vim.cmd.colorscheme, astronvim.default_colorscheme) then + # requrie("astronvim.utils").notify( + # "Error setting up colorscheme: " .. astronvim.default_colorscheme, + # vim.log.levels.ERROR + # ) + # end + # end + # + # require("astronvim.utils").conditional_func(astronvim.user_opts("polish", nil, false), true) + # ''; + # + # plugins = (with pkgs.vimPlugins; [ + # rust-vim + # rust-tools-nvim + # coc-rust-analyzer + # nvim-treesitter-parsers.rust + # nvim-treesitter-parsers.cpp + # nvim-treesitter-parsers.c + # nvim-treesitter-parsers.latex + # coc-rls + # coc-clangd + # clangd_extensions-nvim + # vim-clang-format + # ]); + }; + }; +}