chore: remove dead code

main
LeMarsu 2024-05-28 19:57:07 +02:00
parent 861dd6c22c
commit bbb0953209
2 changed files with 3 additions and 39 deletions

View File

@ -8,8 +8,8 @@
}: let
inherit (builtins) isPath foldl';
inherit (lib.attrsets) attrNames optionalAttrs;
inherit (lib.lists) concatMap optional;
inherit (lib.strings) concatStringsSep fileContents;
inherit (lib.lists) concatMap;
inherit (lib.strings) fileContents;
lua = callPackage ./lua.nix {};
callPackage = lib.callPackageWith (pkgs // dependenciesExtraArgs);
@ -63,25 +63,7 @@
pname = "runtime";
}));
mkSlothFlakePlugin = version: plugins: let
getLua = type: p: let
content = p.${type};
textContent = textOrContent content;
pluginName =
if p.plugin ? name
then p.plugin.name
else baseNameOf p.plugin;
in
optional (! isNull content)
(lua.wrapSelfInvokingFunction {
section = "${type} for ${pluginName}";
lua = textContent;
});
getAllLua = type:
concatStringsSep "\n"
(concatMap (getLua type) plugins);
in
mkSlothFlakePlugin = version: plugins:
vimUtils.buildVimPlugin {
inherit version;
pname = "sloth-flake";
@ -91,14 +73,6 @@
mkdir -p $dir
mv init.lua $dir
cat <<'LUA' > $dir/initialize.lua
${lua.wrapReturnFunction (getAllLua "init")}
LUA
cat <<'LUA' > $dir/config.lua
${lua.wrapReturnFunction (getAllLua "config")}
LUA
cat <<'LUA' > $dir/deps.lua
return ${pluginsLuaDef plugins}
LUA

View File

@ -78,16 +78,6 @@
in rec {
inherit nix2lua;
wrapFunction = content: "function()\n${content}\nend";
wrapReturnFunction = content: "return ${wrapFunction content}";
wrapSelfInvokingFunction = {
section,
lua,
}: ''
-- begin ${section}
(${wrapFunction (removeSuffix "\n" lua)})();
-- end ${section}
'';
raw = data: newAst "raw" {inherit data;};
functionWithArgs = name: args: data: