From b36722bfe60087b2e1b796c0ff8e71c6645f0c6d Mon Sep 17 00:00:00 2001 From: LeMarsu Date: Thu, 6 Jun 2024 22:41:00 +0200 Subject: [PATCH] chore: remove sourcesWith fn, using lib.fileset --- lib/default.nix | 13 ------------- lib/deps.nix | 13 +++++-------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 9c21e8f..ab97d24 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -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; - }; } diff --git a/lib/deps.nix b/lib/deps.nix index 23f84a1..b1ae518 100644 --- a/lib/deps.nix +++ b/lib/deps.nix @@ -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}