2019-04-03 11:06:42 +00:00
{ pkgs ? import <nixpkgs> { } ,
target-os ? " a l l " } :
with pkgs ;
let
projectDeps = import ./default.nix { inherit target-os ; } ;
2019-05-02 18:13:16 +00:00
platform = callPackage ./nix/platform.nix { inherit target-os ; } ;
2019-05-09 13:19:44 +00:00
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-05-09 13:19:44 +00:00
stdenv' = stdenvNoCC ;
mkShell' = mkShell . override { stdenv = stdenv' ; } ;
fastlane' = 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-05-09 13:19:44 +00:00
in mkShell' {
2019-04-03 11:06:42 +00:00
buildInputs = [
# 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-05-09 13:19:44 +00:00
( if useFastlanePkg then [ fastlane' ] else 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-05-13 09:22:29 +00:00
STATUS_REACT_HOME = $ ( git rev-parse - - show-toplevel )
2019-04-03 20:12:31 +00:00
2019-05-13 09:22:29 +00:00
$ { projectDeps . shellHook }
$ { 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-04-03 11:06:42 +00:00
}