-
Notifications
You must be signed in to change notification settings - Fork 466
/
flake.nix
58 lines (56 loc) · 1.63 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
{
description = "Tailscale build environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
android.url = "github:tadfisher/android-nixpkgs";
android.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, android }:
let
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
in
{
devShells = forAllSystems
(system:
let
pkgs = import nixpkgs {
inherit system;
};
android-sdk = android.sdk.${system} (sdkPkgs: with sdkPkgs;
[
build-tools-30-0-2
cmdline-tools-latest
platform-tools
platforms-android-31
platforms-android-30
ndk-23-1-7779620
patcher-v4
]);
in
{
default = (with pkgs; buildFHSUserEnv {
name = "tailscale";
profile = ''
export ANDROID_SDK_ROOT="${android-sdk}/share/android-sdk"
export JAVA_HOME="${jdk8.home}"
'';
targetPkgs = pkgs: with pkgs; [
android-sdk
jdk8
clang
] ++ (if stdenv.isLinux then [
vulkan-headers
libxkbcommon
wayland
xorg.libX11
xorg.libXcursor
xorg.libXfixes
libGL
pkgconfig
] else [ ]);
}).env;
}
);
};
}