-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevshell.nix
More file actions
43 lines (38 loc) · 954 Bytes
/
devshell.nix
File metadata and controls
43 lines (38 loc) · 954 Bytes
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
{ pkgs }:
with pkgs;
let
# android-studio is not available in aarch64-darwin
conditionalPackages = if pkgs.system != "aarch64-darwin" then [ android-studio ] else [ ];
in
with pkgs;
# Configure your development environment.
#
# Documentation: https://github.com/numtide/devshell
devshell.mkShell {
name = "android-project";
motd = ''
Entered the Android app development environment.
'';
env = [
{
name = "ANDROID_HOME";
value = "${android-sdk}/share/android-sdk";
}
{
name = "ANDROID_SDK_ROOT";
value = "${android-sdk}/share/android-sdk";
}
{
name = "JAVA_HOME";
value = jdk.home;
}
];
packages = [
android-sdk
gradle
jdk
(pkgs.writeShellScriptBin "gradle" ''
exec env "ORG_GRADLE_PROJECT_android.aapt2FromMavenOverride"="${android-sdk}/share/android-sdk/build-tools/34.0.0/aapt2" '${gradle}/bin/gradle' $@
'')
] ++ conditionalPackages;
}