2019-11-29 10:20:08 +00:00
|
|
|
{ callPackage, lib, stdenv, mkShell, mergeSh, mkFilter,
|
|
|
|
xcodeWrapper, projectNodePackage, status-go,
|
|
|
|
flock, procps, watchman, bundler, fastlane }:
|
2019-06-04 16:50:29 +00:00
|
|
|
|
|
|
|
let
|
2019-11-29 10:20:08 +00:00
|
|
|
inherit (lib) catAttrs unique;
|
2019-06-04 16:50:29 +00:00
|
|
|
|
2019-11-29 10:20:08 +00:00
|
|
|
pod = callPackage ./pod-shell.nix { };
|
|
|
|
status-go-shell = callPackage ./status-go-shell.nix { inherit status-go; };
|
|
|
|
|
|
|
|
selectedSources = [ status-go fastlane ];
|
2019-06-04 16:50:29 +00:00
|
|
|
|
|
|
|
src =
|
|
|
|
let path = ./../../..;
|
2020-03-30 07:45:25 +00:00
|
|
|
# We use builtins.path so that we can name the resulting derivation,
|
|
|
|
# otherwise the name would be taken from the checkout directory, which is outside of our control
|
|
|
|
in builtins.path {
|
2019-06-04 16:50:29 +00:00
|
|
|
inherit path;
|
2019-07-15 16:34:33 +00:00
|
|
|
name = "status-react-source-npm-deps";
|
2019-06-04 16:50:29 +00:00
|
|
|
filter =
|
2020-03-30 07:45:25 +00:00
|
|
|
# Keep this filter as restrictive as possible in order to avoid
|
|
|
|
# unnecessary rebuilds and limit closure size
|
2019-06-04 16:50:29 +00:00
|
|
|
mkFilter {
|
2020-03-30 07:45:25 +00:00
|
|
|
include = [ ".babelrc" "mobile/js_files.*" ];
|
2019-06-04 16:50:29 +00:00
|
|
|
root = path;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2019-09-13 13:45:24 +00:00
|
|
|
buildInputs = unique ([
|
2019-11-29 10:20:08 +00:00
|
|
|
xcodeWrapper watchman bundler procps
|
2019-09-13 13:45:24 +00:00
|
|
|
flock # used in reset-node_modules.sh
|
|
|
|
] ++ catAttrs "buildInputs" selectedSources);
|
2019-12-04 13:14:55 +00:00
|
|
|
|
2019-06-04 16:50:29 +00:00
|
|
|
shellHook = ''
|
2019-11-29 10:20:08 +00:00
|
|
|
pushd "$STATUS_REACT_HOME" > /dev/null
|
|
|
|
{
|
|
|
|
# Set up symlinks to mobile enviroment in project root
|
|
|
|
ln -sf ./mobile/js_files/metro.config.js ./metro.config.js
|
|
|
|
ln -sf ./mobile/js_files/package.json ./package.json
|
|
|
|
ln -sf ./mobile/js_files/yarn.lock ./yarn.lock
|
|
|
|
|
|
|
|
# check if node modules changed and if so install them
|
|
|
|
./nix/mobile/reset-node_modules.sh "${projectNodePackage}"
|
|
|
|
}
|
|
|
|
popd > /dev/null
|
2019-06-04 16:50:29 +00:00
|
|
|
'';
|
|
|
|
|
2019-11-29 10:20:08 +00:00
|
|
|
localShell = mkShell {
|
2019-12-04 13:14:55 +00:00
|
|
|
inherit buildInputs shellHook;
|
|
|
|
};
|
2019-11-29 10:20:08 +00:00
|
|
|
|
|
|
|
in {
|
|
|
|
inherit shellHook buildInputs pod;
|
|
|
|
|
|
|
|
shell = mergeSh localShell [
|
|
|
|
fastlane.shell status-go-shell pod.shell
|
|
|
|
];
|
2019-06-04 16:50:29 +00:00
|
|
|
}
|