about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorSilvan Mosberger <contact@infinisil.com>2024-06-17 22:03:30 +0200
committerGitHub <noreply@github.com>2024-06-17 22:03:30 +0200
commit96b134d49ff07e220bfe98d413f88be440b50188 (patch)
tree33f692810940a3ac680c2fc6623e681bfe99dfcc /pkgs
parent2b4cb4b1f80801e4089abd029d3e412824f30af4 (diff)
parent02f4e7f5238df2077727b3e7426e24d1e57ee291 (diff)
Merge pull request #320578 from philiptaron/issue-301014/pkgs-yarn2nix
yarn2nix: avoid appearing to include src
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix28
1 files 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 b43bc40c85f6a..3cc5e31c3c152 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.