From fa4998d1f4cbd9618e769709fb9a36b755bb233d Mon Sep 17 00:00:00 2001 From: DavHau Date: Sat, 26 Feb 2022 20:49:57 +0700 Subject: [PATCH] nodejs builder: export all packages from dream-lock --- src/builders/nodejs/granular/default.nix | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/builders/nodejs/granular/default.nix b/src/builders/nodejs/granular/default.nix index 8085ffa1..53164b8c 100644 --- a/src/builders/nodejs/granular/default.nix +++ b/src/builders/nodejs/granular/default.nix @@ -25,9 +25,10 @@ buildPackageWithOtherBuilder, # { builder, name, version }: -> drv # Attributes - subsystemAttrs, # attrset + subsystemAttrs, # attrset defaultPackageName, # string defaultPackageVersion, # string + packages, # list # attrset of pname -> versions, # where versions is a list of version strings @@ -83,9 +84,17 @@ let outputs = { inherit defaultPackage; - packages = { - "${defaultPackageName}"."${defaultPackageVersion}" = defaultPackage; - }; + + # select only the packages listed in dreamLock as main packages + packages = + b.foldl' + (ps: p: ps // p) + {} + (lib.mapAttrsToList + (name: version:{ + "${name}"."${version}" = allPackages."${name}"."${version}"; + }) + packages); }; # This is only executed for electron based packages.