mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
30dd7a9c33
Since buildToolsVersion is not specified in `build.gradle`,
default version is set by Android Gradle Plugin.
Gradle plugin was updated in a77b1a5dd6,
so build tools version should be updated in flake.nix
to the corresponding version, otherwise building
fails while trying to install 35.0.0 into
read-only path managed by Nix.
49 lines
1.5 KiB
Nix
49 lines
1.5 KiB
Nix
{
|
|
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-35-0-0
|
|
cmdline-tools-latest
|
|
platform-tools
|
|
platforms-android-34
|
|
ndk-27-2-12479018
|
|
]);
|
|
rust-version = pkgs.lib.removeSuffix "\n"
|
|
(builtins.readFile ./scripts/rust-toolchain);
|
|
in
|
|
{
|
|
formatter = pkgs.nixpkgs-fmt;
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
ANDROID_SDK_ROOT = "${android-sdk}/share/android-sdk";
|
|
ANDROID_NDK_ROOT =
|
|
"${android-sdk}/share/android-sdk/ndk/27.2.12479018";
|
|
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"
|
|
];
|
|
})
|
|
];
|
|
};
|
|
});
|
|
}
|