-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
57 lines (54 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
# From https://github.com/babariviere/flutter-nix-hello-world/blob/master/flake.nix
# And https://github.com/MikiVanousek/flutter-nix-hello-world/blob/fix/nix/android.nix
{
description = "An example project using flutter";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
config.android_sdk.accept_license = true;
};
buildToolsVersionForAapt2 = "34.0.0-rc4";
in {
devShells.default = let
android = pkgs.androidenv.composeAndroidPackages {
toolsVersion = "26.1.1";
platformToolsVersion = "34.0.5";
buildToolsVersions = [ buildToolsVersionForAapt2 "30.0.3" ];
# buildToolsVersions = [ "30.0.3" ];
includeEmulator = true;
emulatorVersion = "34.1.9";
platformVersions = [ "28" "29" "30" "31" "32" "33" "34" ];
includeSources = false;
includeSystemImages = false;
systemImageTypes = [ "google_apis_playstore" ];
abiVersions = [ "armeabi-v7a" "arm64-v8a" ];
cmakeVersions = [ "3.10.2" ];
includeNDK = true;
ndkVersions = [ "22.0.7026061" ];
useGoogleAPIs = false;
useGoogleTVAddOns = false;
};
in pkgs.mkShell {
buildInputs = with pkgs; [
# from pkgs
flutter
jdk17
#from ./nix/*
android.platform-tools
];
ANDROID_HOME = "${android.androidsdk}/libexec/android-sdk";
GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${android.androidsdk}/libexec/android-sdk/build-tools/${buildToolsVersionForAapt2}/aapt2";
JAVA_HOME = pkgs.jdk17;
ANDROID_AVD_HOME = (toString ./.) + "/.android/avd";
};
});
}