added stuff

This commit is contained in:
vali 2024-04-09 23:11:33 +02:00
commit 7d4f626b7d
907 changed files with 70990 additions and 0 deletions

View file

@ -0,0 +1,57 @@
{
inputs,
pkgs,
lib,
...
}: let
inherit (builtins) filter map toString;
inherit (lib.filesystem) listFilesRecursive;
inherit (lib.strings) hasSuffix fileContents removeSuffix;
inherit (lib.attrsets) genAttrs;
nvf = inputs.neovim-flake;
in {
config = {
programs.neovim-flake = {
enable = true;
settings = {
vim = {
package = pkgs.neovim-unwrapped;
viAlias = true;
vimAlias = true;
enableEditorconfig = true;
preventJunkFiles = true;
enableLuaLoader = true;
useSystemClipboard = true;
spellChecking.enable = false;
debugMode = {
enable = false;
logFile = "/tmp/nvim.log";
};
luaConfigRC = let
inherit (nvf.lib.nvim.dag) entryAnywhere;
# get the name of each lua file in the lua directory, where setting files reside
configPaths = map (f: removeSuffix ".lua" f) (filter (hasSuffix ".lua") (map toString (listFilesRecursive ./lua)));
# get the path of each file by removing the ./. prefix from each element in the list
configNames = map (p: removeSuffix "./" p) configPaths;
# generates a key-value pair that looks roughly as follows:
# "fileName" = entryAnywhere "<contents of ./lua/fileName.lua>"
# which is expected by neovim-flake's modified DAG library
luaConfig = genAttrs configNames (name:
entryAnywhere ''
${fileContents "${name}.lua"}
'');
in
luaConfig;
};
};
};
};
}