diff --git a/nix/default.nix b/nix/default.nix index 9d364cef1b..94c9fc4c25 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 @@ -36,8 +38,15 @@ let } '' mkdir $out cd $out - cp ${packageLock} ./package-lock.json - cp ${packageJson} ./package.json + ${builtins.concatStringsSep "\n" + (builtins.map + (modulePath: + "cp ${modulePath} ./${builtins.baseNameOf (builtins.toString modulePath)} -r") + submodules + ) + } + cp ${packageLock} ./package-lock.json -f + cp ${packageJson} ./package.json -f node2nix ${pkgs.lib.optionalString withDevDeps "--development" } \ --lock ./package-lock.json -i ./package.json '')