about summary refs log tree commit diff
path: root/shell.nix
diff options
context:
space:
mode:
Diffstat (limited to 'shell.nix')
-rw-r--r--shell.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/shell.nix b/shell.nix
new file mode 100644
index 000000000..9af021cbc
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,33 @@
+with import <nixpkgs> {
+  config.allowUnfree = true;
+  config.android_sdk.accept_license = true;
+};
+let
+  buildToolsVersion = "35.0.0";
+  cmakeVersion = "3.22.1";
+  androidComposition = androidenv.composeAndroidPackages {
+    platformVersions = [ "35" ];
+    buildToolsVersions = [ buildToolsVersion ];
+    ndkVersions = [ "27.1.12297006" ];
+    cmakeVersions = [ cmakeVersion ];
+    includeNDK = true;
+    includeSystemImages = false;
+    includeSources = false;
+  };
+in
+mkShell rec {
+  buildInputs = [ androidComposition.androidsdk zulu17 nodejs yarn eas-cli ];
+
+  ANDROID_HOME = "${androidComposition.androidsdk}/libexec/android-sdk";
+  ANDROID_NDK_ROOT = "${ANDROID_HOME}/ndk-bundle";
+
+  JAVA_HOME = zulu17.home;
+
+  # Use the same buildToolsVersion here
+  GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${ANDROID_HOME}/build-tools/${buildToolsVersion}/aapt2";
+
+  # Use the same cmakeVersion here
+  shellHook = ''
+    export PATH="$(echo "$ANDROID_HOME/cmake/${cmakeVersion}".*/bin):$PATH"
+  '';
+}