forked from bepass-org/oblivion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
70 lines (66 loc) · 2.48 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
description = "oblivion";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
devshell.url = "github:numtide/devshell";
flake-utils.url = "github:numtide/flake-utils";
android.url = "github:tadfisher/android-nixpkgs";
};
outputs = { self, nixpkgs, devshell, flake-utils, android }:
{
overlay = final: prev: {
inherit (self.packages.${final.system}) android-sdk android-studio;
};
}
//
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 = [
devshell.overlays.default
self.overlay
];
};
in
{
packages = {
android-sdk = android.sdk.${system} (sdkPkgs: with sdkPkgs; [
# Useful packages for building and testing.
build-tools-34-0-0
cmdline-tools-latest
emulator
platform-tools
platforms-android-34
# Other useful packages for a development environment.
ndk-26-1-10909125
# skiaparser-3
# sources-android-34
]
++ lib.optionals (system == "aarch64-darwin") [
# system-images-android-34-google-apis-arm64-v8a
# system-images-android-34-google-apis-playstore-arm64-v8a
]
++ lib.optionals (system == "x86_64-darwin" || system == "x86_64-linux") [
system-images-android-31-google-apis-x86-64
system-images-android-31-google-apis-playstore-x86-64
system-images-android-32-google-apis-x86-64
system-images-android-32-google-apis-playstore-x86-64
system-images-android-33-google-apis-x86-64
system-images-android-33-google-apis-playstore-x86-64
system-images-android-34-google-apis-x86-64
system-images-android-34-google-apis-playstore-x86-64
]);
} // lib.optionalAttrs (system == "x86_64-linux") {
# Android Studio in nixpkgs is currently packaged for x86_64-linux only.
android-studio = pkgs.androidStudioPackages.stable;
# android-studio = pkgs.androidStudioPackages.beta;
# android-studio = pkgs.androidStudioPackages.preview;
# android-studio = pkgs.androidStudioPackage.canary;
};
devShell = import ./devshell.nix { inherit pkgs; };
}
);
}