Merge pull request #320578 from philiptaron/issue-301014/pkgs-yarn2nix

yarn2nix: avoid appearing to include src
This commit is contained in:
Silvan Mosberger
2024-06-17 22:03:30 +02:00
committed by GitHub
@@ -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.