forked from deltachat/deltachat-android
-
Notifications
You must be signed in to change notification settings - Fork 5
/
flake.nix
45 lines (43 loc) · 1.46 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
{
description = "Delta Chat for Android";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
android.url = "github:tadfisher/android-nixpkgs";
};
outputs = { self, nixpkgs, rust-overlay, flake-utils, android }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; };
android-sdk = android.sdk.${system} (sdkPkgs:
with sdkPkgs; [
build-tools-33-0-1
cmdline-tools-latest
platform-tools
platforms-android-34
ndk-27-0-11902837
]);
rust-version = pkgs.lib.removeSuffix "\n"
(builtins.readFile ./scripts/rust-toolchain);
in {
devShells.default = pkgs.mkShell {
ANDROID_SDK_ROOT = "${android-sdk}/share/android-sdk";
ANDROID_NDK_ROOT =
"${android-sdk}/share/android-sdk/ndk/27.0.11902837";
buildInputs = [
android-sdk
pkgs.openjdk17
(pkgs.buildPackages.rust-bin.stable."${rust-version}".minimal.override {
targets = [
"armv7-linux-androideabi"
"aarch64-linux-android"
"i686-linux-android"
"x86_64-linux-android"
];
})
];
};
});
}