-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
97 lines (85 loc) · 2.38 KB
/
flake.nix
File metadata and controls
97 lines (85 loc) · 2.38 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
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
{
description = "Flutter development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-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 = {
allowUnfree = true;
android_sdk.accept_license = true;
};
};
# Android SDKの構成
buildToolsVersion = "34.0.0";
androidComposition = pkgs.androidenv.composeAndroidPackages {
buildToolsVersions = [
"35.0.0"
buildToolsVersion
"30.0.3"
"28.0.3"
];
platformVersions = [
"36"
"35"
"34"
"33"
"30"
];
abiVersions = [
"armeabi-v7a"
"arm64-v8a"
"x86_64"
];
ndkVersions = ["28.2.13676358"];
cmakeVersions = ["3.22.1"];
includeEmulator = true;
includeSystemImages = true;
systemImageTypes = ["google_apis_playstore"];
includeNDK = true;
};
androidSdk = androidComposition.androidsdk;
in
{
devShell =
with pkgs;
mkShell rec {
ANDROID_SDK_ROOT = "${androidSdk}/libexec/android-sdk";
ANDROID_HOME = ANDROID_SDK_ROOT;
JAVA_HOME = jdk17.home;
CHROME_EXECUTABLE = "${chromium}/bin/chromium";
buildInputs = [
flutter
androidSdk
jdk17
# Web
chromium
# Linux
pkg-config
gtk3
];
shellHook = ''
export ANDROID_SDK_ROOT="${androidSdk}/libexec/android-sdk"
export ANDROID_HOME=$ANDROID_SDK_ROOT
# Fix TLS certificate issues for workerd (Cloudflare Workers)
export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
export NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt
flutter config --android-sdk $ANDROID_SDK_ROOT
flutter config --no-analytics
echo "SDK: $ANDROID_SDK_ROOT"
flutter --version
'';
};
}
);
}