-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
58 lines (51 loc) · 1.25 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{ pkgs ? import <nixpkgs> (import ./config.nix) }:
let
bin-path = pkgs.lib.makeBinPath [
# used in ./gradlew script
pkgs.coreutils
pkgs.findutils
pkgs.gnused
# used by some gradle tasks
pkgs.nodejs
];
# needed for desktop target (via downloaded skiko)
ld-library-path = pkgs.lib.makeLibraryPath [
pkgs.libGL
];
# needed for android target
android = pkgs.androidenv.composeAndroidPackages {
toolsVersion = null;
includeEmulator = false;
platformVersions = [ "34" ];
includeSources = false;
includeSystemImages = false;
systemImageTypes = [];
abiVersions = [];
cmakeVersions = [];
includeNDK = false;
ndkVersions = [];
useGoogleAPIs = false;
useGoogleTVAddOns = false;
includeExtras = [];
};
inherit (android) androidsdk;
gradle = pkgs.writeShellApplication {
name = "gradle";
text = ''
if [[ ! -f "./gradlew" ]]; then
echo "Cannot find gradle wrapper (./gradlew)" >&1
exit 1
fi
PATH=${bin-path} \
LD_LIBRARY_PATH=${ld-library-path} \
JAVA_HOME=${pkgs.jre} \
ANDROID_HOME=${androidsdk}/libexec/android-sdk \
exec "./gradlew" -PnixManaged=true "$@"
'';
};
in
pkgs.mkShell {
packages = [
gradle
];
}