modules: move local functions to extended library

This commit is contained in:
raf 2024-02-23 18:59:05 +03:00
commit f70238d539
No known key found for this signature in database
GPG key ID: 02D1DD3FA08B6B29
6 changed files with 63 additions and 527 deletions

15
lib/build.nix Normal file
View file

@ -0,0 +1,15 @@
{
# TODO: give those section indicators
# maybe using mkSection?
wrapLuaConfig = {
luaConfigBefore,
luaConfig,
luaConfigAfter,
}: ''
lua << EOF
${luaConfigBefore}
${luaConfig}
${luaConfigAfter}
EOF
'';
}

View file

@ -126,4 +126,10 @@ in {
else abort ("Dependency cycle in ${name}: " + toJSON sortedDag);
in
result;
# Create a section in the final output
mkSection = section: ''
-- SECTION: ${section.name}
${section.data}
'';
}