master
nix 52 lines 1.41 KB
Raw
1 {
2 description = "My Android project";
3
4 inputs = {
5 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6 devshell.url = "github:numtide/devshell";
7 flake-utils.url = "github:numtide/flake-utils";
8 android.url = "github:tadfisher/android-nixpkgs";
9 };
10
11 outputs = { self, nixpkgs, devshell, flake-utils, android }:
12 {
13 overlay = final: prev: {
14 inherit (self.packages.${final.system}) android-sdk android-studio;
15 };
16 }
17 //
18 flake-utils.lib.eachSystem [ "aarch64-darwin" "x86_64-darwin" "x86_64-linux" ] (system:
19 let
20 inherit (nixpkgs) lib;
21 pkgs = import nixpkgs {
22 inherit system;
23 config.allowUnfree = true;
24 overlays = [
25 devshell.overlays.default
26 self.overlay
27 ];
28 };
29 in
30 {
31 packages = {
32 android-sdk = android.sdk.${system} (sdkPkgs: with sdkPkgs; [
33 # Useful packages for building and testing.
34 build-tools-30-0-3
35 cmdline-tools-latest
36 platform-tools
37 platforms-android-32
38 platforms-android-33
39 platforms-android-34
40 emulator
41
42 # Other useful packages for a development environment.
43 ndk-26-1-10909125
44 # skiaparser-3
45 # sources-android-34
46 ]);
47 };
48
49 devShell = import ./devshell.nix { inherit pkgs; };
50 }
51 );
52 }