2022-12-02 18:03:35 +00:00
|
|
|
{
|
|
|
|
/* This should match Nixpkgs commit in status-mobile. */
|
|
|
|
source ? builtins.fetchTarball {
|
|
|
|
url = "https://github.com/NixOS/nixpkgs/archive/579238da5f431b7833a9f0681663900aaf0dd1e8.zip";
|
|
|
|
sha256 = "sha256:0a77c8fq4145k0zdmsda9cmhfw84ipf9nhvvn0givzhza1500g3h";
|
|
|
|
},
|
|
|
|
pkgs ? import (source){
|
|
|
|
config = {
|
|
|
|
allowUnfree = true;
|
|
|
|
android_sdk.accept_license = true;
|
|
|
|
};
|
|
|
|
overlays = [
|
|
|
|
(self: super: {
|
|
|
|
androidPkgs = pkgs.androidenv.composeAndroidPackages {
|
|
|
|
toolsVersion = "26.1.1";
|
|
|
|
platformToolsVersion = "33.0.2";
|
|
|
|
buildToolsVersions = [ "31.0.0" ];
|
|
|
|
platformVersions = [ "31" ];
|
|
|
|
cmakeVersions = [ "3.18.1" ];
|
|
|
|
ndkVersion = "22.1.7171670";
|
|
|
|
includeNDK = true;
|
|
|
|
includeExtras = [
|
|
|
|
"extras;android;m2repository"
|
|
|
|
"extras;google;m2repository"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
})
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}:
|
|
|
|
|
2023-01-16 13:32:56 +00:00
|
|
|
let
|
|
|
|
inherit (pkgs) lib stdenv;
|
|
|
|
|
|
|
|
/* No Android SDK for Darwin aarch64. */
|
|
|
|
isMacM1 = stdenv.isDarwin && stdenv.isAarch64;
|
|
|
|
/* Lock requires Xcode verison. */
|
|
|
|
xcodeWrapper = pkgs.xcodeenv.composeXcodeWrapper { version = "14.2"; };
|
|
|
|
/* Gomobile also needs the Xcode wrapper. */
|
|
|
|
gomobileMod = pkgs.gomobile.override {
|
|
|
|
inherit xcodeWrapper;
|
|
|
|
withAndroidPkgs = !isMacM1;
|
|
|
|
};
|
|
|
|
in pkgs.mkShell {
|
2022-12-02 18:03:35 +00:00
|
|
|
name = "status-go-shell";
|
|
|
|
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
git jq which
|
2023-01-16 13:32:56 +00:00
|
|
|
go_1_18 golangci-lint gopls go-bindata gomobileMod
|
2022-12-02 18:03:35 +00:00
|
|
|
mockgen protobuf3_17 protoc-gen-go
|
2023-01-16 13:32:56 +00:00
|
|
|
] ++ lib.optional stdenv.isDarwin xcodeWrapper;
|
2022-12-02 18:03:35 +00:00
|
|
|
|
2023-01-16 13:32:56 +00:00
|
|
|
shellHook = lib.optionalString (!isMacM1) ''
|
|
|
|
ANDROID_HOME=${pkgs.androidPkgs.androidsdk}/libexec/android-sdk
|
|
|
|
ANDROID_NDK=$ANDROID_HOME/ndk-bundle
|
2022-12-02 18:03:35 +00:00
|
|
|
ANDROID_SDK_ROOT=$ANDROID_HOME
|
|
|
|
ANDROID_NDK_HOME=$ANDROID_NDK
|
|
|
|
'';
|
2023-01-03 14:58:17 +00:00
|
|
|
|
|
|
|
# Sandbox causes Xcode issues on MacOS. Requires sandbox=relaxed.
|
|
|
|
# https://github.com/status-im/status-mobile/pull/13912
|
2023-01-16 13:32:56 +00:00
|
|
|
__noChroot = stdenv.isDarwin;
|
2022-12-02 18:03:35 +00:00
|
|
|
}
|