-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathflake.nix
111 lines (107 loc) · 3.24 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
{
inputs = {
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
android-nixpkgs.url = "github:tadfisher/android-nixpkgs";
};
nixConfig = {
substituters = [
"https://cache.nixos.org"
"https://cache.onyx.ovh"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"cache.onyx.ovh:2wUG6wsx5slbKUgkHT6GJuQ5k2StuUc8ysZQ2W+fbxA="
];
};
outputs = {
self,
nixpkgs,
flake-parts,
...
} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
perSystem = {
pkgs,
system,
lib,
...
}: {
devShells.default = let
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
android_sdk.accept_license = true;
};
overlays = [];
};
flutter_rust_bridge_codegen = pkgs.callPackage nix/flutter_rust_bridge_codegen/package.nix {};
android-nixpkgs = pkgs.callPackage inputs.android-nixpkgs {};
androidSdk = android-nixpkgs.sdk (sdkPkgs:
with sdkPkgs; [
cmdline-tools-latest
build-tools-34-0-0
build-tools-30-0-3
platform-tools
platforms-android-34
platforms-android-33
platforms-android-31
platforms-android-30
emulator
]);
PWD = builtins.getEnv "PWD";
in
pkgs.mkShell {
CHROME_EXECUTABLE = lib.getExe pkgs.chromium;
ANDROID_SDK_ROOT = "${androidSdk}/libexec/android-sdk";
ANDROID_NDK_ROOT = "${androidSdk}/libexec/android-sdk/ndk-bundle";
ANDROID_AVD_HOME = "${PWD}/.android/avd";
ANDROID_HOME = "${androidSdk}/libexec/android-sdk";
FLUTTER_SDK = "${pkgs.flutter}";
GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${androidSdk}/share/android-sdk/build-tools/34.0.0/aapt2";
LD_LIBRARY_PATH = "${PWD}/apps/onyx/build/linux/x64/debug/bundle/lib/:${PWD}/apps/onyx/build/linux/x64/release/bundle/lib/:${PWD}/apps/onyx/build/linux/x64/profile/bundle/lib/";
buildInputs = with pkgs; [
flutter_rust_bridge_codegen
chromium
flutter
melos
jdk17
androidSdk
at-spi2-core
clang
dart
dbus
util-linux
cmake
ninja
libsecret
android-tools
pkg-config
gtk3
glib
pcre2
pcre
libselinux
libsepol
libthai
libdatrie
xorg.libXdmcp
libxkbcommon
xorg.libXtst
libepoxy
libgcrypt
libgpg-error
apksigner
zenity
lerc
];
};
formatter = pkgs.alejandra;
};
};
}