2019-06-19 09:54:14 +00:00
{ nixpkgs-bootstrap ? import ./nix/nixpkgs-bootstrap.nix { } ,
pkgs ? nixpkgs-bootstrap . pkgs ,
2019-04-03 11:06:42 +00:00
target-os ? " a l l " } :
let
2019-06-19 09:54:14 +00:00
projectDeps = import ./default.nix { inherit target-os pkgs nixpkgs-bootstrap ; inherit ( nixpkgs-bootstrap ) config ; } ;
2019-07-04 14:49:21 +00:00
platform = pkgs . callPackage ./nix/platform.nix { inherit target-os ; } ;
useFastlanePkg = ( platform . targetAndroid && ! stdenv . isDarwin ) ;
2019-04-03 11:06:42 +00:00
# TODO: Try to use stdenv for iOS. The problem is with building iOS as the build is trying to pass parameters to Apple's ld that are meant for GNU's ld (e.g. -dynamiclib)
2019-07-04 14:49:21 +00:00
stdenv = pkgs . stdenvNoCC ;
mkShell = pkgs . mkShell . override { inherit stdenv ; } ;
fastlane = pkgs . callPackage ./fastlane {
2019-04-03 20:12:31 +00:00
bundlerEnv = _ : pkgs . bundlerEnv {
name = " f a s t l a n e - g e m s " ;
gemdir = ./fastlane ;
} ;
} ;
2019-04-03 11:06:42 +00:00
2019-07-04 14:49:21 +00:00
in mkShell {
buildInputs = with pkgs ; [
2019-04-03 11:06:42 +00:00
# utilities
bash
curl
2019-04-29 16:33:40 +00:00
file
2019-04-03 11:06:42 +00:00
git
2019-04-29 16:33:40 +00:00
gnumake
2019-04-03 11:06:42 +00:00
jq
ncurses
lsof # used in scripts/start-react-native.sh
ps # used in scripts/start-react-native.sh
unzip
wget
2019-04-03 20:12:31 +00:00
] ++
2019-07-04 14:49:21 +00:00
( if useFastlanePkg then [ fastlane ] else with pkgs ; lib . optionals platform . targetMobile [ bundler ruby ] ) ; # bundler/ruby used for fastlane on macOS
2019-04-03 11:06:42 +00:00
inputsFrom = [ projectDeps ] ;
2019-05-13 09:22:29 +00:00
TARGET_OS = target-os ;
shellHook = ''
set - e
2019-04-29 16:33:40 +00:00
2019-06-04 17:00:19 +00:00
export STATUS_REACT_HOME = $ ( git rev-parse - - show-toplevel )
2019-05-22 16:04:45 +00:00
export PATH = $ STATUS_REACT_HOME/node_modules/.bin : $ PATH
2019-04-03 20:12:31 +00:00
2019-05-13 09:22:29 +00:00
$ { projectDeps . shellHook }
2019-07-04 14:49:21 +00:00
$ { stdenv . lib . optionalString useFastlanePkg fastlane . shellHook }
2019-04-03 20:12:31 +00:00
2019-05-13 09:22:29 +00:00
if [ " $ I N _ N I X _ S H E L L " != ' pure' ] && [ ! - f $ STATUS_REACT_HOME/.ran-setup ] ; then
$ STATUS_REACT_HOME/scripts/setup
touch $ STATUS_REACT_HOME/.ran-setup
fi
set + e
'' ;
2019-05-10 15:33:54 +00:00
}