diff --git a/ci/utils.groovy b/ci/utils.groovy index 94a76918a6..ae6baffa96 100644 --- a/ci/utils.groovy +++ b/ci/utils.groovy @@ -38,7 +38,7 @@ def nix_fastlane_sh(cmd) { . ~/.nix-profile/etc/profile.d/nix.sh set -x nix-shell --argstr target-os \'${env.TARGET_OS}\' \\ - ${pureFlag} --run \'printenv && \$FASTLANE_SCRIPT ${cmd}\' \\ + ${pureFlag} --run \'fastlane ${cmd}\' \\ \'${env.WORKSPACE}/shell.nix\' """ } diff --git a/fastlane/default.nix b/fastlane/default.nix index c55422da6a..00bf8bfe43 100644 --- a/fastlane/default.nix +++ b/fastlane/default.nix @@ -33,12 +33,9 @@ let }; }; -in { - package = fastlane; - +in fastlane // { shellHook = '' export FASTLANE_PLUGINFILE_PATH=$PWD/fastlane/Pluginfile - export FASTLANE_SCRIPT="${fastlane}/bin/fastlane" # the ruby package also exposes the fastlane Gem, so we want to make sure we don't rely on PATH ordering to get the right package ''; } diff --git a/shell.nix b/shell.nix index 51e5b19278..46a318be71 100644 --- a/shell.nix +++ b/shell.nix @@ -5,18 +5,18 @@ with pkgs; let projectDeps = import ./default.nix { inherit target-os; }; platform = callPackage ./nix/platform.nix { inherit target-os; }; - useFastlanePkg = (platform.targetAndroid && !_stdenv.isDarwin); + useFastlanePkg = (platform.targetAndroid && !stdenv'.isDarwin); # 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) - _stdenv = stdenvNoCC; - _mkShell = mkShell.override { stdenv = _stdenv; }; - _fastlane = callPackage ./fastlane { + stdenv' = stdenvNoCC; + mkShell' = mkShell.override { stdenv = stdenv'; }; + fastlane' = callPackage ./fastlane { bundlerEnv = _: pkgs.bundlerEnv { name = "fastlane-gems"; gemdir = ./fastlane; }; }; -in _mkShell { +in mkShell' { buildInputs = [ # utilities bash @@ -31,7 +31,7 @@ in _mkShell { unzip wget ] ++ - (if useFastlanePkg then [ _fastlane.package ] else lib.optionals platform.targetMobile [ bundler ruby ]); # bundler/ruby used for fastlane on macOS + (if useFastlanePkg then [ fastlane' ] else lib.optionals platform.targetMobile [ bundler ruby ]); # bundler/ruby used for fastlane on macOS inputsFrom = [ projectDeps ]; TARGET_OS=target-os; shellHook = @@ -41,7 +41,7 @@ in _mkShell { STATUS_REACT_HOME=$(git rev-parse --show-toplevel) ${projectDeps.shellHook} - ${lib.optionalString useFastlanePkg _fastlane.shellHook} + ${lib.optionalString useFastlanePkg fastlane'.shellHook} if [ ! -f $STATUS_REACT_HOME/.ran-setup ]; then $STATUS_REACT_HOME/scripts/setup