Skip to content

Commit

Permalink
Support npm submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
SeungheonOh committed Mar 20, 2023
1 parent 205f25b commit 2cd308c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -36,6 +38,13 @@ let
} ''
mkdir $out
cd $out
${builtins.concatStringsSep "\n"
(builtins.map
(modulePath:
"cp ${modulePath} ./${builtins.baseNameOf (builtins.toString modulePath)} -r")
submodules
)
}
cp ${packageLock} ./package-lock.json
cp ${packageJson} ./package.json
node2nix ${pkgs.lib.optionalString withDevDeps "--development" } \
Expand Down

0 comments on commit 2cd308c

Please sign in to comment.