From c41bbe462d93dc39e1d70b18464c40d717c2a67a Mon Sep 17 00:00:00 2001 From: Seungheon Oh Date: Fri, 17 Mar 2023 18:22:09 -0500 Subject: [PATCH 1/3] Support npm submodules --- nix/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nix/default.nix b/nix/default.nix index 9d364cef1..610caa082 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -20,6 +20,8 @@ , spagoPackages ? "${src}/spago-packages.nix" # Configuration that will be used to generate a `devShell` for the project , shell ? { } + # Path to submodule locations that needs to be copied when making node env +, submodules ? [ ] , ... }: let @@ -38,6 +40,13 @@ let cd $out cp ${packageLock} ./package-lock.json cp ${packageJson} ./package.json + cp ${ + pkgs.linkFarm "node-packages-${projectName}-source" + (builtins.map (path: { + inherit path; + name = builtins.baseNameOf (builtins.toString path); + }) submodules) + }/* . -r node2nix ${pkgs.lib.optionalString withDevDeps "--development" } \ --lock ./package-lock.json -i ./package.json '') From 202dd1b11fd37b1f76ef8c207d809a94a94c6d7d Mon Sep 17 00:00:00 2001 From: Vladimir Kalnitsky Date: Tue, 28 Mar 2023 14:41:38 +0300 Subject: [PATCH 2/3] Update nix/default.nix --- nix/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/default.nix b/nix/default.nix index 610caa082..2430cc104 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -20,7 +20,7 @@ , spagoPackages ? "${src}/spago-packages.nix" # Configuration that will be used to generate a `devShell` for the project , shell ? { } - # Path to submodule locations that needs to be copied when making node env + # Paths to submodule locations that need to be copied when constructing the NodeJS environment , submodules ? [ ] , ... }: From 5d438c87d4b13c4d7eac23ec88a79f11048dcbf5 Mon Sep 17 00:00:00 2001 From: SeungheonOh Date: Thu, 6 Apr 2023 11:39:20 -0500 Subject: [PATCH 3/3] Update nix/default.nix Co-authored-by: emiflake --- nix/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/default.nix b/nix/default.nix index 2430cc104..6d2abc73d 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -40,13 +40,13 @@ let cd $out cp ${packageLock} ./package-lock.json cp ${packageJson} ./package.json - cp ${ + ${pkgs.lib.optionalString (builtins.length submodules != 0) "cp ${ pkgs.linkFarm "node-packages-${projectName}-source" (builtins.map (path: { inherit path; name = builtins.baseNameOf (builtins.toString path); }) submodules) - }/* . -r + }/* . -r"} node2nix ${pkgs.lib.optionalString withDevDeps "--development" } \ --lock ./package-lock.json -i ./package.json '')