From 02f4e7f5238df2077727b3e7426e24d1e57ee291 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Mon, 17 Jun 2024 10:11:50 -0700 Subject: [PATCH] yarn2nix: avoid appearing to include src This expression didn't actually include src, but it looked like it did. Make it like others by using a fileset (for instance, #319883) --- .../yarn2nix-moretea/yarn2nix/default.nix | 28 ++++++------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix b/pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix index b43bc40c85f6..3cc5e31c3c15 100644 --- a/pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix +++ b/pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix @@ -398,25 +398,15 @@ in rec { }); yarn2nix = mkYarnPackage { - src = - let - src = ./.; - - mkFilter = { dirsToInclude, filesToInclude, root }: path: type: - let - inherit (lib) elem elemAt splitString; - - subpath = elemAt (splitString "${toString root}/" path) 1; - spdir = elemAt (splitString "/" subpath) 0; - in elem spdir dirsToInclude || - (type == "regular" && elem subpath filesToInclude); - in builtins.filterSource - (mkFilter { - dirsToInclude = ["bin" "lib"]; - filesToInclude = ["package.json" "yarn.lock"]; - root = src; - }) - src; + src = lib.fileset.toSource { + root = ./.; + fileset = lib.fileset.unions [ + ./bin + ./lib + ./package.json + ./yarn.lock + ]; + }; # yarn2nix is the only package that requires the yarnNix option. # All the other projects can auto-generate that file.