status-react/nix/mobile/fastlane/default.nix

36 lines
1.0 KiB
Nix

{ stdenv, target-os, callPackage, mkShell, makeWrapper,
bundlerEnv, bundler, ruby, curl }:
let
inherit (stdenv.lib) optionals optionalString unique;
platform = callPackage ../../platform.nix { inherit target-os; };
useFastlanePkg = platform.targetAndroid && !stdenv.isDarwin;
fastlane = callPackage ../../../fastlane {
bundlerEnv = _:
bundlerEnv {
name = "fastlane-gems";
gemdir = ../../../fastlane;
};
};
bundlerDeps = optionals platform.targetMobile [
bundler
ruby
]; # bundler/ruby used for fastlane on macOS
shellHook = optionalString useFastlanePkg fastlane.shellHook;
# TARGETS
shell = mkShell {
buildInputs = if useFastlanePkg then [ fastlane curl ] else bundlerDeps;
inherit shellHook;
};
in {
# 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
inherit shell;
}