forked from ZeusWPI/hydra-react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
76 lines (75 loc) · 2.33 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
description = "virtual environments";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
devshell = {
url = "github:numtide/devshell";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, flake-utils, devshell, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
config.android_sdk.accept_license = true;
overlays = [ devshell.overlays.default ];
};
androidComposition = pkgs.androidenv.composeAndroidPackages {
toolsVersion = null;
platformToolsVersion = "34.0.4";
buildToolsVersions = [ "34.0.0" "30.0.3" ];
includeEmulator = true;
includeSystemImages = true;
abiVersions = [ "x86_64" ];
emulatorVersion = "33.1.6";
platformVersions = [ "34" "33" ];
systemImageTypes = [ "google_apis_playstore" ];
cmakeVersions = [ "3.22.1" ];
includeNDK = true;
ndkVersions = ["23.1.7779620"];
useGoogleAPIs = true;
includeExtras = [
"extras;google;gcm"
];
extraLicenses = [
"android-sdk-license"
];
};
androidRootSdk = "${androidComposition.androidsdk}/libexec/android-sdk";
in
{
devShells.default = pkgs.devshell.mkShell {
name = "hydra-react-native";
packages = with pkgs; [
jdk11 gradle git androidComposition.androidsdk
nodejs nodePackages.yarn android-studio
watchman
];
env = with pkgs; [
{
name = "ANDROID_HOME";
value = androidRootSdk;
}
{
name = "ANDROID_SDK_ROOT";
value = androidRootSdk;
}
{
name = "ANDROID_NDK_ROOT";
value = "${androidRootSdk}/ndk-bundle";
}
{
name = "GRADLE_OPTS";
value = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${androidRootSdk}/build-tools/34.0.0/aapt2";
}
{
name = "JAVA_HOME";
value = jdk11.home;
}
];
};
});
}