new lazy rice

This commit is contained in:
iofq 2024-08-19 01:38:09 -05:00
parent 1eb2b1bc3c
commit ece2c1c694
33 changed files with 1132 additions and 780 deletions

View file

@ -91,60 +91,38 @@ with lib;
src = nvimRtpSrc;
buildPhase = ''
mkdir -p $out/nvim
mkdir -p $out/lua
rm init.lua
'';
installPhase = ''
cp -r after $out/after
rm -r after
cp -r lua $out/lua
rm -r lua
cp -r * $out/nvim
'';
};
# The final init.lua content that we pass to the Neovim wrapper.
# It wraps the user init.lua, prepends the lua lib directory to the RTP
# and prepends the nvim and after directory to the RTP
# It also adds logic for bootstrapping dev plugins (for plugin developers)
initLua =
''
vim.loader.enable()
-- prepend lua directory
initLua = ''
vim.opt.rtp:prepend('${nvimRtp}/lua')
''
# Wrap init.lua
+ (builtins.readFile ../nvim/init.lua)
# Bootstrap/load dev plugins
+ optionalString (devPlugins != []) (
''
local dev_pack_path = vim.fn.stdpath('data') .. '/site/pack/dev'
local dev_plugins_dir = dev_pack_path .. '/opt'
local dev_plugin_path
''
+ strings.concatMapStringsSep
"\n"
(plugin: ''
dev_plugin_path = dev_plugins_dir .. '/${plugin.name}'
if vim.fn.empty(vim.fn.glob(dev_plugin_path)) > 0 then
vim.notify('Bootstrapping dev plugin ${plugin.name} ...', vim.log.levels.INFO)
vim.cmd('!${pkgs.git}/bin/git clone ${plugin.url} ' .. dev_plugin_path)
end
vim.cmd('packadd! ${plugin.name}')
'')
devPlugins
)
# Prepend nvim and after directories to the runtimepath
# NOTE: This is done after init.lua,
# because of a bug in Neovim that can cause filetype plugins
# to be sourced prematurely, see https://github.com/neovim/neovim/issues/19008
# We prepend to ensure that user ftplugins are sourced before builtin ftplugins.
+ ''
vim.opt.rtp:prepend('${nvimRtp}/nvim')
vim.opt.rtp:prepend('${nvimRtp}/after')
'';
lazy_opts = {
performance = {
reset_packpath = false,
rtp = { reset = false, },
},
dev = {
path = "${pkgs.neovimUtils.packDir neovimConfig.packpathDirs}/pack/myNeovimPackages/start",
patterns = {""},
},
install = { missing = false, },
spec = {{ import = "plugins" }},
disabled_plugins = {
"netrwPlugin",
"tutor",
"zipPlugin",
},
}
'' + (builtins.readFile ../nvim/init.lua);
# Add arguments to the Neovim wrapper script
extraMakeWrapperArgs = builtins.concatStringsSep " " (

View file

@ -11,6 +11,8 @@ with final.pkgs.lib; let
version = src.lastModifiedDate;
};
snipe-nvim = mkNvimPlugin inputs.snipe-nvim "snipe-nvim";
nvim-early-retirement = mkNvimPlugin inputs.nvim-early-retirement "nvim-early-retirement";
workspace-diagnostics-nvim = mkNvimPlugin inputs.workspace-diagnostics-nvim "workspace-diagnostics-nvim";
mkNeovim = pkgs.callPackage ./mkNeovim.nix { inherit pkgs-wrapNeovim; };
@ -26,7 +28,7 @@ with final.pkgs.lib; let
eyeliner-nvim
friendly-snippets
gitsigns-nvim
lualine-nvim
lazy-nvim
luasnip
markview-nvim
mini-nvim
@ -35,8 +37,13 @@ with final.pkgs.lib; let
none-ls-nvim
nightfox-nvim
nvim-cmp
nvim-dap
nvim-dap-go
nvim-dap-ui
nvim-early-retirement
nvim-lspconfig
nvim-neoclip-lua
nvim-nio
nvim-treesitter-context
nvim-treesitter-textobjects
(nvim-treesitter.withPlugins(p: with p; [
@ -68,6 +75,7 @@ with final.pkgs.lib; let
]))
nvim-web-devicons
oil-nvim
outline-nvim
scope-nvim
snipe-nvim
telescope-fzf-native-nvim
@ -75,29 +83,38 @@ with final.pkgs.lib; let
toggleterm-nvim
trouble-nvim
undotree
which-key-nvim
workspace-diagnostics-nvim
];
extraPackages = with pkgs; [
basePackages = with pkgs; [
ripgrep
yamllint
];
extraPackages = with pkgs; [
# linters
puppet-lint
yamllint
# LSPs
gopls
python312Packages.jedi-language-server
lua-language-server
nil
phpactor
python312Packages.jedi-language-server
# debuggers
delve
];
in {
nvim-pkg = mkNeovim {
plugins = all-plugins;
appName = "nvim";
inherit extraPackages;
extraPackages = basePackages ++ extraPackages;
};
nvim-min-pkg = mkNeovim {
plugins = all-plugins;
appName = "nvim";
extraPackages = [];
extraPackages = basePackages;
};
nvim-luarc-json = final.mk-luarc-json {