chore: remove dead code
parent
861dd6c22c
commit
bbb0953209
32
lib/deps.nix
32
lib/deps.nix
|
|
@ -8,8 +8,8 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) isPath foldl';
|
inherit (builtins) isPath foldl';
|
||||||
inherit (lib.attrsets) attrNames optionalAttrs;
|
inherit (lib.attrsets) attrNames optionalAttrs;
|
||||||
inherit (lib.lists) concatMap optional;
|
inherit (lib.lists) concatMap;
|
||||||
inherit (lib.strings) concatStringsSep fileContents;
|
inherit (lib.strings) fileContents;
|
||||||
lua = callPackage ./lua.nix {};
|
lua = callPackage ./lua.nix {};
|
||||||
|
|
||||||
callPackage = lib.callPackageWith (pkgs // dependenciesExtraArgs);
|
callPackage = lib.callPackageWith (pkgs // dependenciesExtraArgs);
|
||||||
|
|
@ -63,25 +63,7 @@
|
||||||
pname = "runtime";
|
pname = "runtime";
|
||||||
}));
|
}));
|
||||||
|
|
||||||
mkSlothFlakePlugin = version: plugins: let
|
mkSlothFlakePlugin = version: plugins:
|
||||||
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
|
|
||||||
vimUtils.buildVimPlugin {
|
vimUtils.buildVimPlugin {
|
||||||
inherit version;
|
inherit version;
|
||||||
pname = "sloth-flake";
|
pname = "sloth-flake";
|
||||||
|
|
@ -91,14 +73,6 @@
|
||||||
mkdir -p $dir
|
mkdir -p $dir
|
||||||
mv init.lua $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
|
cat <<'LUA' > $dir/deps.lua
|
||||||
return ${pluginsLuaDef plugins}
|
return ${pluginsLuaDef plugins}
|
||||||
LUA
|
LUA
|
||||||
|
|
|
||||||
10
lib/lua.nix
10
lib/lua.nix
|
|
@ -78,16 +78,6 @@
|
||||||
in rec {
|
in rec {
|
||||||
inherit nix2lua;
|
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;};
|
raw = data: newAst "raw" {inherit data;};
|
||||||
|
|
||||||
functionWithArgs = name: args: data:
|
functionWithArgs = name: args: data:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue