-
Notifications
You must be signed in to change notification settings - Fork 155
/
flake.nix
56 lines (54 loc) · 1.7 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
46
47
48
49
50
51
52
53
54
55
56
{
description = "Branch Android SDK for deep linking and attribution";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
android.url = "github:tadfisher/android-nixpkgs";
};
outputs = { self, nixpkgs, flake-utils, android }: flake-utils.lib.eachSystem [ "aarch64-darwin" "x86_64-darwin" "x86_64-linux" ] (system:
let
inherit (nixpkgs) lib;
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
(final: prev: {
android-sdk = android.sdk.${system} (sdkPkgs: with sdkPkgs; [
build-tools-34-0-0
cmdline-tools-latest
emulator
platform-tools
platforms-android-34
]
++ lib.optionals (system == "aarch64-darwin") [
system-images-android-34-google-apis-arm64-v8a
]
++ lib.optionals (system == "x86_64-darwin" || system == "x86_64-linux") [
system-images-android-34-google-apis-x86-64
]);
})
];
};
in
{
formatter = pkgs.nixpkgs-fmt;
devShells = {
default = pkgs.mkShell {
name = "branch-sdk-android";
ANDROID_HOME = "${pkgs.android-sdk}/share/android-sdk";
ANDROID_SDK_ROOT = "${pkgs.android-sdk}/share/android-sdk";
JAVA_HOME = "${pkgs.jdk17.home}";
shellHook = ''
echo "
Entered the Branch SDK Android development environment.
";
'';
packages = [
pkgs.android-sdk
pkgs.jdk17 # for android build-tools
];
};
};
}
);
}