chore: remove sourcesWith fn, using lib.fileset

main
LeMarsu 2024-06-06 22:41:00 +02:00
parent 61381e2ba0
commit b36722bfe6
2 changed files with 5 additions and 21 deletions

View File

@ -2,17 +2,4 @@
types = import ./types.nix {inherit yants;};
in {
mkNeovimPkg = import ./mkNeovimPkg.nix {inherit version types;};
sourcesWith = path: paths: let
samePath = a: let a' = builtins.toString a; in b: a' == builtins.toString b;
isRoot = samePath "/";
isInPath = path: subPath:
if isRoot subPath
then false
else (samePath path subPath) || (isInPath path (builtins.dirOf subPath));
filter = src: _type: builtins.any (includePath: isInPath includePath src) paths;
in
builtins.path {
inherit path filter;
};
}

View File

@ -122,16 +122,13 @@
vimUtils.buildVimPlugin {
inherit version;
pname = "sloth-flake";
src = ../lua/sloth-flake;
src = with lib.fileset;
toSource {
root = ../.;
fileset = ../lua/sloth-flake;
};
buildPhase = ''
dir=lua/sloth-flake
mkdir -p $dir
mv *.lua $dir
for d in *; do
if [[ -d "$d" ]] && [[ "$d" != 'lua' ]]; then
mv "$d" $dir
fi
done
cat <<'LUA' > $dir/dependencies.lua
${pluginsLuaDef plugins}