nix: Minor cleanup of fastlane expression

Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
Pedro Pombeiro 2019-05-09 15:19:44 +02:00
parent a753be4ab9
commit cc009a3c2c
No known key found for this signature in database
GPG Key ID: C4A24185B2AA48A1
3 changed files with 9 additions and 12 deletions

View File

@ -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\'
"""
}

View File

@ -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
'';
}

View File

@ -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