diff --git a/lib/deps.nix b/lib/deps.nix index 3edfca5..d62e0bf 100644 --- a/lib/deps.nix +++ b/lib/deps.nix @@ -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 diff --git a/lib/lua.nix b/lib/lua.nix index 257a8ab..3cfc225 100644 --- a/lib/lua.nix +++ b/lib/lua.nix @@ -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: