forked from fcitx5-android/fcitx5-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
63 lines (61 loc) · 2.04 KB
/
flake.nix
File metadata and controls
63 lines (61 loc) · 2.04 KB
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
{
description = "Dev shell flake for fcitx5-android";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
outputs = { self, nixpkgs, ... }:
let
pkgs = import nixpkgs {
system = "x86_64-linux";
config.android_sdk.accept_license = true;
config.allowUnfree = true;
overlays = [ self.overlays.default ];
};
in with pkgs;
with fcitx5-android-sdk;
{
devShells.x86_64-linux.default = mkShell {
buildInputs = [
androidComposition.androidsdk
extra-cmake-modules
gettext
python39
icu
androidStudioPackages.stable
];
ANDROID_SDK_ROOT =
"${androidComposition.androidsdk}/libexec/android-sdk";
NDK_VERSION = ndkVersion;
GRADLE_OPTS =
"-Dorg.gradle.project.android.aapt2FromMavenOverride=${androidComposition.androidsdk}/libexec/android-sdk/build-tools/${buildToolsVersion}/aapt2";
ECM_DIR = "${extra-cmake-modules}/share/ECM/cmake/";
JAVA_HOME = "${jdk11}";
shellHook = ''
export PATH="$ANDROID_SDK_ROOT/cmake/${cmakeVersion}/bin:$PATH"
echo sdk.dir=$ANDROID_SDK_ROOT > local.properties
'';
};
} // {
overlays.default = final: prev: {
fcitx5-android-sdk = rec {
cmakeVersion = "3.22.1";
buildToolsVersion = "33.0.0";
platformToolsVersion = "33.0.3";
platformVersion = "33";
ndkVersion = "25.0.8775105";
abiVersions = [ "arm64-v8a" "armeabi-v7a" ];
androidComposition = prev.androidenv.composeAndroidPackages {
inherit platformToolsVersion ndkVersion;
buildToolsVersions = [ buildToolsVersion ];
platformVersions = [ platformVersion ];
inherit abiVersions;
cmakeVersions = [ cmakeVersion ];
includeNDK = true;
includeEmulator = false;
};
};
};
};
}