-
-
Notifications
You must be signed in to change notification settings - Fork 191
/
shell.nix
34 lines (29 loc) · 1.04 KB
/
shell.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
{ pkgs ? import <nixpkgs> {
config.android_sdk.accept_license = true;
config.allowUnfree = true;
} }:
let
jdk = pkgs.openjdk17;
build_tools_version = "33.0.1";
android = pkgs.androidenv.composeAndroidPackages {
buildToolsVersions = [ build_tools_version ];
platformVersions = [ "34" ];
abiVersions = [ "armeabi-v7a" ];
};
ANDROID_SDK_ROOT = "${android.androidsdk}/libexec/android-sdk";
gradle = pkgs.gradle.override { java = jdk; };
# Without this option, aapt2 fails to run with a permissions error.
gradle_wrapped = pkgs.runCommandLocal "gradle-wrapped" {
nativeBuildInputs = with pkgs; [ makeBinaryWrapper ];
} ''
mkdir -p $out/bin
ln -s ${gradle}/bin/gradle $out/bin/gradle
wrapProgram $out/bin/gradle \
--add-flags "-Dorg.gradle.project.android.aapt2FromMavenOverride=${ANDROID_SDK_ROOT}/build-tools/${build_tools_version}/aapt2"
'';
in pkgs.mkShell {
buildInputs =
[ pkgs.findutils pkgs.fontforge jdk android.androidsdk gradle_wrapped ];
JAVA_HOME = jdk.home;
inherit ANDROID_SDK_ROOT;
}