-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
72 lines (66 loc) · 2.11 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
{
description = "Liquid SDK React Native Demo Flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
# nixpkgs.url = "github:NixOS/nixpkgs/24.05";
flake-utils.url = "github:numtide/flake-utils";
android-nixpkgs.url = "github:tadfisher/android-nixpkgs";
};
outputs = { self, nixpkgs, flake-utils, android-nixpkgs }: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config = {
android_sdk.accept_license = true;
allowUnfree = true;
};
};
pinnedJDK = pkgs.jdk17;
buildToolsVersion = "35.0.0";
ndkVersion = "26.1.10909125";
androidComposition = pkgs.androidenv.composeAndroidPackages {
cmdLineToolsVersion = "8.0";
toolsVersion = "26.1.1";
platformToolsVersion = "34.0.4";
buildToolsVersions = [ buildToolsVersion "34.0.0" ];
includeEmulator = true;
emulatorVersion = "35.1.4";
platformVersions = [ "35" "34" ];
includeSources = false;
includeSystemImages = true;
systemImageTypes = [ "google_apis_playstore" ];
abiVersions = [ "x86_64" ];
cmakeVersions = [ "3.10.2" "3.22.1" ];
includeNDK = true;
ndkVersions = [ ndkVersion ];
useGoogleAPIs = false;
useGoogleTVAddOns = false;
includeExtras = [
"extras;google;gcm"
];
};
sdk = androidComposition.androidsdk;
in
{
devShell = pkgs.mkShell rec {
buildInputs = with pkgs; [
# Android
pinnedJDK
sdk
pkg-config
# TS/JS
pnpm
nodejs_20
typescript
# LSP
ast-grep
eslint_d
typescript-language-server
];
JAVA_HOME = pinnedJDK;
ANDROID_SDK_ROOT = "${androidComposition.androidsdk}/libexec/android-sdk";
ANDROID_NDK_ROOT = "${ANDROID_SDK_ROOT}/ndk/${ndkVersion}";
GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${ANDROID_SDK_ROOT}/build-tools/${buildToolsVersion}/aapt2";
};
});
}