-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
flake.nix
49 lines (47 loc) · 1.53 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config = {
android_sdk.accept_license = true;
allowUnfree = true;
};
};
# Android
androidSdkArgs = {
buildToolsVersions = [ "30.0.3" ];
platformVersions = [ "34" ];
};
androidComposition =
pkgs.androidenv.composeAndroidPackages androidSdkArgs;
androidSdk = androidComposition.androidsdk;
androidEmulator = pkgs.androidenv.emulateApp {
name = "Emulator";
platformVersion = "34";
systemImageType = "google_apis_playstore";
abiVersion = "x86_64";
configOptions = {
# https://android.googlesource.com/platform/external/qemu/+/refs/heads/master/android/avd/hardware-properties.ini
"hw.ramSize" = "4096";
"hw.lcd.width" = "1170";
"hw.lcd.height" = "2532";
"hw.lcd.density" = "460";
"hw.keyboard" = "yes";
};
sdkExtraArgs = androidSdkArgs;
};
in {
devShell = with pkgs;
mkShell {
ANDROID_SDK_ROOT = "${androidSdk}/libexec/android-sdk";
FLUTTER_ROOT = flutter;
buildInputs = [ androidEmulator androidSdk flutter ];
};
});
}