mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-07 12:45:57 +01:00
init
This commit is contained in:
parent
4b868d0de6
commit
94003faec6
2 changed files with 34 additions and 10 deletions
|
@ -92,8 +92,10 @@ inputs: {
|
|||
extraLuaPackages = ps: map (x: ps.${x}) vimOptions.luaPackages;
|
||||
extraPython3Packages = ps: map (x: ps.${x}) vimOptions.python3Packages;
|
||||
|
||||
extraWrapperArgs =
|
||||
concatStringsSep " " (optional (vimOptions.extraPackages != []) ''--prefix PATH : "${makeBinPath vimOptions.extraPackages}"'');
|
||||
extraWrapperArgs = concatStringsSep " " (optional (vimOptions.extraPackages != []) ''
|
||||
--unset XDG_DATA_DIRS \
|
||||
--prefix PATH : "${makeBinPath vimOptions.extraPackages}"
|
||||
'');
|
||||
|
||||
# wrap user's desired neovim package with the desired neovim configuration
|
||||
# using wrapNeovimUnstable and makeNeovimConfig from nixpkgs.
|
||||
|
@ -119,6 +121,8 @@ in {
|
|||
inherit (module) options config;
|
||||
inherit (module._module.args) pkgs;
|
||||
|
||||
# expose wrapped neovim-package
|
||||
neovim = neovim-wrapped;
|
||||
# expose wrapped neovim package
|
||||
neovim = neovim-wrapped.overrideAttrs (old: {
|
||||
generatedWrapperArgs = (old.generatedWrapperArgs or []) ++ ["--set" "NVIM_APPNAME" "nvf"];
|
||||
});
|
||||
}
|
||||
|
|
|
@ -60,6 +60,13 @@ in {
|
|||
path = ./runtime;
|
||||
name = "nvim-runtime";
|
||||
})
|
||||
|
||||
# as a Neovim plugin - pure, reproducible and follows Neovim practices
|
||||
(pkgs.vimUtils.buildVimPlugin {
|
||||
pname = "nvim-runtime";
|
||||
src = ./nvim-runtime; # needs a plugin/init.lua, can refer to modules in a root level lua/ dir
|
||||
version = "#";
|
||||
})
|
||||
]
|
||||
'';
|
||||
|
||||
|
@ -133,14 +140,27 @@ in {
|
|||
-- Remove default user runtime paths from the
|
||||
-- `runtimepath` option to avoid leaking user configuration
|
||||
-- into the final neovim wrapper
|
||||
local defaultRuntimePaths = {
|
||||
vim.fn.stdpath('config'), -- $HOME/.config/nvim
|
||||
vim.fn.stdpath('config') .. "/after", -- $HOME/.config/nvim/after
|
||||
vim.fn.stdpath('data') .. "/site", -- $HOME/.local/share/nvim/site
|
||||
}
|
||||
local defaultRuntimePaths = {}
|
||||
local function addPath(path)
|
||||
table.insert(defaultRuntimePaths, path)
|
||||
table.insert(defaultRuntimePaths, path .. "/site")
|
||||
end
|
||||
|
||||
-- Add standard paths to the table
|
||||
addPath(vim.fn.stdpath('config')) -- $HOME/.config/nvim
|
||||
addPath(vim.fn.stdpath('data')) -- $HOME/.local/share
|
||||
addPath(vim.fn.stdpath('state')) -- $HOME/.local/state
|
||||
addPath(vim.fn.stdpath('cache')) -- $HOME/.cache/nvim
|
||||
addPath(vim.fn.stdpath('config_dirs'))
|
||||
addPath(vim.fn.stdpath('data_dirs'))
|
||||
|
||||
for _, path in ipairs(defaultRuntimePaths) do
|
||||
-- Check if the path exists in runtimepath before removing it
|
||||
if vim.fn.index(vim.opt.runtimepath, path) >= 0 then
|
||||
vim.opt.runtimepath:remove(path)
|
||||
else
|
||||
print("Path does not exist in runtimepath:", path)
|
||||
end
|
||||
end
|
||||
''}
|
||||
|
||||
|
|
Loading…
Reference in a new issue