Nvim : Use gen function for customRC.

This commit is contained in:
Dmitry Voronin 2024-03-09 00:06:53 +03:00
parent c7354d4135
commit 31031a8bf4

View file

@ -1,5 +1,13 @@
{ environment, inputs, ... }: let { environment, inputs, ... }: let
nvimSrc = "/etc/nvim"; nvimSrc = "/etc/nvim";
nvimRc = { runtimes, cfgs }: let
runtimeRc = builtins.foldl' (acc: r:
acc + "set runtimepath+=${r}\n"
) "" runtimes;
cfgRc = builtins.foldl' (acc: c:
acc + "lua dofile(\"${nvimSrc}/${c}\")\n"
) "" cfgs;
in runtimeRc + cfgRc;
in { in {
environment.etc.nvim.source = ./nvim; environment.etc.nvim.source = ./nvim;
@ -8,73 +16,76 @@ in {
viAlias = true; viAlias = true;
vimAlias = true; vimAlias = true;
configure = { configure = {
customRC = '' customRC = nvimRc {
set runtimepath+=~/.cache/nvim runtimes = [
set runtimepath+=~/.cache/nvim/treesitter "~/.cache/nvim"
set runtimepath+=${inputs.nvimAlign} "~/.cache/nvim/treesitter"
set runtimepath+=${inputs.nvimAutoclose} "${inputs.nvimAlign}"
set runtimepath+=${inputs.nvimBufferline} "${inputs.nvimAutoclose}"
set runtimepath+=${inputs.nvimCloseBuffers} "${inputs.nvimBufferline}"
set runtimepath+=${inputs.nvimDevicons} "${inputs.nvimCloseBuffers}"
set runtimepath+=${inputs.nvimGitsigns} "${inputs.nvimDevicons}"
set runtimepath+=${inputs.nvimGruvboxMaterial} "${inputs.nvimGitsigns}"
set runtimepath+=${inputs.nvimIndentoMatic} "${inputs.nvimGruvboxMaterial}"
set runtimepath+=${inputs.nvimLspconfig} "${inputs.nvimIndentoMatic}"
set runtimepath+=${inputs.nvimLualine} "${inputs.nvimLspconfig}"
set runtimepath+=${inputs.nvimOllama} "${inputs.nvimLualine}"
set runtimepath+=${inputs.nvimPlenary} "${inputs.nvimOllama}"
set runtimepath+=${inputs.nvimSingleComment} "${inputs.nvimPlenary}"
set runtimepath+=${inputs.nvimTelescope} "${inputs.nvimSingleComment}"
set runtimepath+=${inputs.nvimTodo} "${inputs.nvimTelescope}"
set runtimepath+=${inputs.nvimTokyonight} "${inputs.nvimTodo}"
set runtimepath+=${inputs.nvimTreesitter} "${inputs.nvimTokyonight}"
set runtimepath+=${inputs.nvimTree} "${inputs.nvimTreesitter}"
set runtimepath+=${inputs.nvimTrouble} "${inputs.nvimTree}"
set runtimepath+=${inputs.nvimWhichKey} "${inputs.nvimTrouble}"
"${inputs.nvimWhichKey}"
lua dofile("${nvimSrc}/key/Rekey.lua") ];
lua dofile("${nvimSrc}/key/Leader.lua") cfgs = [
lua dofile("${nvimSrc}/config/Autoread.lua") "key/Rekey.lua"
lua dofile("${nvimSrc}/config/Etc.lua") "key/Leader.lua"
lua dofile("${nvimSrc}/config/Search.lua") "config/Autoread.lua"
lua dofile("${nvimSrc}/config/Tab.lua") "config/Etc.lua"
lua dofile("${nvimSrc}/plugin/Filetree.lua") "config/Search.lua"
lua dofile("${nvimSrc}/plugin/lsp/Rust.lua") "config/Tab.lua"
lua dofile("${nvimSrc}/plugin/lsp/Tex.lua") "plugin/Filetree.lua"
lua dofile("${nvimSrc}/plugin/Gruvbox.lua") "plugin/lsp/Rust.lua"
lua dofile("${nvimSrc}/plugin/Bufferline.lua") "plugin/lsp/Tex.lua"
lua dofile("${nvimSrc}/plugin/Lualine.lua") "plugin/Gruvbox.lua"
lua dofile("${nvimSrc}/plugin/Autoclose.lua") "plugin/Bufferline.lua"
lua dofile("${nvimSrc}/plugin/Gitsigns.lua") "plugin/Lualine.lua"
lua dofile("${nvimSrc}/plugin/Trouble.lua") "plugin/Autoclose.lua"
lua dofile("${nvimSrc}/plugin/Tokyonight.lua") "plugin/Gitsigns.lua"
lua dofile("${nvimSrc}/plugin/Closebuffers.lua") "plugin/Trouble.lua"
lua dofile("${nvimSrc}/plugin/Telescope.lua") "plugin/Tokyonight.lua"
lua dofile("${nvimSrc}/plugin/Todo.lua") "plugin/Closebuffers.lua"
lua dofile("${nvimSrc}/plugin/Indent.lua") "plugin/Telescope.lua"
lua dofile("${nvimSrc}/plugin/Align.lua") "plugin/Todo.lua"
lua dofile("${nvimSrc}/plugin/Treesitter.lua") "plugin/Indent.lua"
lua dofile("${nvimSrc}/plugin/Fold.lua") "plugin/Align.lua"
lua dofile("${nvimSrc}/plugin/Ollama.lua") "plugin/Treesitter.lua"
lua dofile("${nvimSrc}/key/Autocomplete.lua") "plugin/Fold.lua"
lua dofile("${nvimSrc}/key/Buffer.lua") "plugin/Ollama.lua"
lua dofile("${nvimSrc}/key/Colorscheme.lua") "key/Autocomplete.lua"
lua dofile("${nvimSrc}/key/Comment.lua") "key/Buffer.lua"
lua dofile("${nvimSrc}/key/Common.lua") "key/Colorscheme.lua"
lua dofile("${nvimSrc}/key/Filetree.lua") "key/Comment.lua"
lua dofile("${nvimSrc}/key/Fold.lua") "key/Common.lua"
lua dofile("${nvimSrc}/key/Gitsigns.lua") "key/Filetree.lua"
lua dofile("${nvimSrc}/key/Lsp.lua") "key/Fold.lua"
lua dofile("${nvimSrc}/key/Navigation.lua") "key/Gitsigns.lua"
lua dofile("${nvimSrc}/key/Ollama.lua") "key/Lsp.lua"
lua dofile("${nvimSrc}/key/Sort.lua") "key/Navigation.lua"
lua dofile("${nvimSrc}/key/Telescope.lua") "key/Ollama.lua"
lua dofile("${nvimSrc}/key/Terminal.lua") "key/Sort.lua"
lua dofile("${nvimSrc}/key/Todo.lua") "key/Telescope.lua"
lua dofile("${nvimSrc}/key/Trouble.lua") "key/Terminal.lua"
lua dofile("${nvimSrc}/key/Update.lua") "key/Todo.lua"
lua dofile("${nvimSrc}/key/Whichkey.lua") "key/Trouble.lua"
''; "key/Update.lua"
"key/Whichkey.lua"
];
};
}; };
}; };
} }