-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathflake.nix
More file actions
87 lines (79 loc) · 2.32 KB
/
flake.nix
File metadata and controls
87 lines (79 loc) · 2.32 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
{
description = "native_toolchain_rust";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
utils,
}:
utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in
{
formatter = pkgs.nixfmt-tree;
devShells = {
default = pkgs.mkShell {
packages = with pkgs; [
flutter
rustup
llvmPackages_20.clangUseLLVM
];
env = {
FLUTTER_ROOT = "${pkgs.flutter}";
RUST_BACKTRACE = "1";
LIBCLANG_PATH = "${pkgs.llvmPackages_20.libclang.lib}/lib";
};
shellHook = ''
export PATH=$HOME/.pub-cache/bin:$PATH
dart pub global activate melos
'';
};
android =
let
arch = builtins.head (builtins.split "-" system);
androidEnv = pkgs.androidenv.override { licenseAccepted = true; };
androidComposition = androidEnv.composeAndroidPackages {
platformVersions = [
"35"
"36"
];
buildToolsVersions = [ "35.0.0" ];
cmakeVersions = [ "3.22.1" ];
includeNDK = true;
ndkVersions = [ "27.0.12077973" ];
# For the emulator:
includeEmulator = true;
includeSystemImages = true;
systemImageTypes = [ "default" ];
abiVersions = [
{
"x86_64" = "x86_64";
"aarch64" = "arm64-v8a";
}
.${arch} or (throw "Unsupported architecture: ${arch}")
];
};
in
pkgs.mkShell {
packages = with pkgs; [
androidComposition.androidsdk
jdk17
];
env = rec {
ANDROID_HOME = "${androidComposition.androidsdk}/libexec/android-sdk";
ANDROID_NDK_ROOT = "${ANDROID_HOME}/ndk-bundle";
};
};
};
}
);
}