top-level/output: add global table top of init.lua

Creating a global table at top of init.lua to allow sharing between
different sections of the init.lua without worrying about ordering.
This commit is contained in:
Austin Horstman 2024-08-21 10:52:35 -05:00
parent 45081d5f21
commit 203d31810f
No known key found for this signature in database

View file

@ -285,12 +285,21 @@ in
'';
};
extraConfigLuaPre = lib.mkIf config.wrapRc ''
-- Ignore the user lua configuration
vim.opt.runtimepath:remove(vim.fn.stdpath('config')) -- ~/.config/nvim
vim.opt.runtimepath:remove(vim.fn.stdpath('config') .. "/after") -- ~/.config/nvim/after
vim.opt.runtimepath:remove(vim.fn.stdpath('data') .. "/site") -- ~/.local/share/nvim/site
'';
extraConfigLuaPre = lib.mkOrder 100 (
# Add a global table at start of init
''
-- Nixvim's internal module table
-- Can be used to share code throughout init.lua
local _M = {}
''
+ lib.optionalString config.wrapRc ''
-- Ignore the user lua configuration
vim.opt.runtimepath:remove(vim.fn.stdpath('config')) -- ~/.config/nvim
vim.opt.runtimepath:remove(vim.fn.stdpath('config') .. "/after") -- ~/.config/nvim/after
vim.opt.runtimepath:remove(vim.fn.stdpath('data') .. "/site") -- ~/.local/share/nvim/site
''
);
extraPlugins = lib.mkIf config.wrapRc [ config.filesPlugin ];
};