-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
flake.nix
53 lines (50 loc) · 1.66 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
{
inputs = {
nixpkgs.url =
"github:nixos/nixpkgs?ref=a22a985f13d58b2bafb4964dd2bdf6376106a2d2";
# https://github.com/NixOS/nixpkgs/pull/311815
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;
};
};
flutter = pkgs.flutterPackages.v3_22;
# 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 ];
};
});
}