Jakub Sokołowski f2c96dcd3b
nix: add config defaults and temp keystore generation
Changes:
* Create `nix/config.nix` with `config` defaults
* Add `nix/tools/gradlePropParser.nix` for reading `gradle.properties`
* Add `nix/mobile/android/keystore.nix` for generating a keystore
* Load keystore generation in `nix/mobile/android/default.nix`
* Use generated keystore if it's not provided via `config`
* Add `-deststoretype pkcs12` in `scripts/generate-keystore.sh`
* Add `nix/lib/assertEnvVarSet.nix` for checking if env var is set

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-06-04 11:10:48 +02:00

57 lines
1.4 KiB
Nix

{ lib, pkgs, deps, callPackage, mkShell
, status-go, androidPkgs, androidShell }:
let
# For generating a temporary keystore for local development
keystore = callPackage ./keystore.nix { };
# Import a jsbundle compiled out of clojure codebase
jsbundle = callPackage ./jsbundle { };
# Import a patched version of watchman (important for sandboxed builds on macOS)
watchmanFactory = callPackage ./watchman.nix { };
# TARGETS
release = callPackage ./release.nix {
inherit keystore jsbundle status-go watchmanFactory;
};
in {
# TARGETS
inherit keystore release jsbundle;
shell = mkShell {
buildInputs = with pkgs; [
openjdk
gradle
lsof # used in start-react-native.sh
flock # used in nix/scripts/node_modules.sh
];
inputsFrom = [
release
androidShell
];
shellHook = ''
export ANDROID_SDK_ROOT="${androidPkgs}"
export ANDROID_NDK_ROOT="${androidPkgs}/ndk-bundle"
export STATUS_NIX_MAVEN_REPO="${deps.gradle}"
# required by some makefile targets
export STATUS_GO_ANDROID_LIBDIR=${status-go}
{
cd "$STATUS_REACT_HOME"
# Set up symlinks to mobile enviroment in project root
ln -sf ./mobile/js_files/* ./
# check if node modules changed and if so install them
$STATUS_REACT_HOME/nix/scripts/node_modules.sh ${deps.nodejs-patched}
}
'';
};
}