nix: Only include fastlane in main shell when targetting iOS.

This sidesteps an issue where Nix complains about mismatched hashes in `ruby2.5.3-unf_ext-0.0.7.6` expression for Android CI builds.

Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
Pedro Pombeiro 2019-07-15 12:17:21 +02:00
parent a7fd659d84
commit 90fbcfab2b
No known key found for this signature in database
GPG Key ID: C4A24185B2AA48A1
1 changed files with 9 additions and 4 deletions

View File

@ -2,6 +2,8 @@
bundlerEnv, bundler, ruby, curl }: bundlerEnv, bundler, ruby, curl }:
let let
inherit (stdenv.lib) optionals optionalString unique;
platform = callPackage ../../platform.nix { inherit target-os; }; platform = callPackage ../../platform.nix { inherit target-os; };
useFastlanePkg = platform.targetAndroid && !stdenv.isDarwin; useFastlanePkg = platform.targetAndroid && !stdenv.isDarwin;
fastlane = callPackage ../../../fastlane { fastlane = callPackage ../../../fastlane {
@ -10,16 +12,19 @@ let
gemdir = ../../../fastlane; gemdir = ../../../fastlane;
}; };
}; };
buildInputs = if useFastlanePkg then [ fastlane curl ] else stdenv.lib.optionals platform.targetMobile [ bundler ruby ]; # bundler/ruby used for fastlane on macOS bundlerDeps = optionals platform.targetMobile [ bundler ruby ];
shellHook = stdenv.lib.optionalString useFastlanePkg fastlane.shellHook; shellHook = optionalString useFastlanePkg fastlane.shellHook;
# TARGETS # TARGETS
shell = mkShell { shell = mkShell {
inherit buildInputs shellHook; buildInputs = if useFastlanePkg then [ fastlane curl ] else bundlerDeps; # bundler/ruby used for fastlane on macOS
inherit shellHook;
}; };
in { in {
inherit buildInputs shellHook; # We only include bundler in regular shell if targetting iOS, because that's how the CI builds the whole project
buildInputs = unique (optionals (!useFastlanePkg && platform.targetIOS) bundlerDeps);
inherit shellHook;
# TARGETS # TARGETS
inherit shell; inherit shell;