-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
126 lines (113 loc) · 4.35 KB
/
Copy pathflake.nix
File metadata and controls
126 lines (113 loc) · 4.35 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# THIS DOESN'T WORK. I was never able to get the flutter audio plugin to build on nixos.
{
description = "the flutter devshell definition for nixos developers";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
# not doing android builds for now, mobile is no fun
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
config.android_sdk.accept_license = true;
};
android = pkgs.androidenv.composeAndroidPackages {
toolsVersion = "26.1.1";
platformToolsVersion = "36.0.0";
buildToolsVersions = [ "30.0.1" "33.0.1" ];
includeEmulator = true;
# emulatorVersion = "36.1.2";
platformVersions = [ "36" ];
includeSources = false;
includeSystemImages = true;
# we need "google_apis" here but it doesn't build, nix hashes are wrong
systemImageTypes = [ "google_apis_playstore" ];
abiVersions = [ "armeabi-v7a" "arm64-v8a" ];
cmakeVersions = [ "3.10.2" ];
includeNDK = true;
ndkVersions = [ "28.1.13356709" ];
useGoogleAPIs = true;
useGoogleTVAddOns = false;
# extraLicenses = [
# "android-googletv-license"
# "android-sdk-arm-dbt-license"
# "android-sdk-license"
# "android-sdk-preview-license"
# "google-gdk-license"
# "intel-android-extra-license"
# "intel-android-sysimage-license"
# "mips-android-sysimage-license"
# ];
};
in {
devShells.default =
pkgs.mkShell {
buildInputs = with pkgs; [
flutter329
# flutter327
jdk17
android.platform-tools
android.androidsdk
gst_all_1.gstreamer
gst_all_1.gstreamer.dev
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
gst_all_1.gst-libav
# included for SoLoud
alsa-lib
alsa-lib.dev
pkg-config
gtk3
gtk3.dev
sysprof
# actually including glibc breaks glibc functionality lmao
# glibc
ninja
];
# nativeBuildInputs = with pkgs; [
# pkg-config
# ];
shellHook = ''
export PS1="$PS1 (❄ "
'';
# relative paths don't work :/
# export LD_LIBRARY_PATH="$PWD/lib/:$LD_LIBRARY_PATH"
# export LD_LIBRARY_PATH="./build/linux/x64/debug/plugins/flutter_soloud/:$LD_LIBRARY_PATH"
# export PKG_CONFIG_PATH="${pkgs.gst_all_1.gstreamer.dev}/lib/pkgconfig:${pkgs.gst_all_1.gst-plugins-base.dev}/lib/pkgconfig:$PKG_CONFIG_PATH"
ANDROID_HOME = android.androidsdk + /libexec/android-sdk;
JAVA_HOME = pkgs.jdk17;
ANDROID_AVD_HOME = (toString ./.) + "/.android/avd";
ANDROID_SDK_ROOT = android.androidsdk + /libexec/android-sdk;
};
# needed because gradle wants to use dynamic linking or something. I don't understand why this is a problem.
# this isn't working. can't accept licenses. Unsure what happened with the above.
devShells.fhs = (pkgs.buildFHSEnv {
name = "flutter-android-env";
targetPkgs = pkgs': with pkgs'; [
flutter327
jdk17
android.platform-tools
android.androidsdk
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
gst_all_1.gst-libav
glibc
pkg-config
];
# profile = ''
# export ANDROID_HOME=${pkgs.android.androidsdk}/libexec/android-sdk
# export JAVA_HOME=${pkgs.jdk17}
# export ANDROID_AVD_HOME=$PWD/.android/avd
# export ANDROID_SDK_ROOT=${pkgs.android.androidsdk}/libexec/android-sdk
# '';
shellHook = ''
export PS1="$PS1 (❄ "
'';
runScript = "bash";
}).env;
});
}