chore: add a nix shell for the multiplatform client
CI / build (push) Successful in 1m29s

The shell provides JDK 21, Gradle 8, Node 22, Android SDK 35 with
build-tools 35.0.0, and the libraries Compose Desktop and Java Sound need.
The Android license is accepted in the shell config; documented in the
README.
This commit is contained in:
TapTap committed 2026-11-14 21:33:45 +00:00
1 parent 7fb41b5ad4
commit 9cdbb3702e
2 files changed
+75

No files matched your search

+67
View File
@@ -0,0 +1,67 @@
{ pkgs ? import <nixpkgs> {
# The Android SDK is unfree and requires accepting Google's license.
# Setting this here asserts that you accept it for this dev shell.
config = {
allowUnfree = true;
android_sdk.accept_license = true;
};
}
}:
let
jdk = pkgs.jdk21;
gradle = pkgs.gradle_8;
node = pkgs.nodejs_22;
androidPackages = pkgs.androidenv.composeAndroidPackages {
platformVersions = [ "35" ];
buildToolsVersions = [ "35.0.0" ];
includeEmulator = false;
includeSystemImages = false;
includeNDK = false;
};
androidSdk = "${androidPackages.androidsdk}/libexec/android-sdk";
desktopLibs = with pkgs; [
libGL
xorg.libX11
xorg.libXext
xorg.libXrender
fontconfig
freetype
alsa-lib
];
in
pkgs.mkShell {
packages = with pkgs; [
jdk
gradle
node
zip
unzip
git
curl
python3
] ++ desktopLibs;
JAVA_HOME = jdk.home;
ANDROID_HOME = androidSdk;
ANDROID_SDK_ROOT = androidSdk;
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath desktopLibs;
shellHook = ''
export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/cmdline-tools/latest/bin:$PATH"
echo "AudioManager client dev shell"
echo " Java: $(java -version 2>&1 | head -1)"
echo " Gradle: $(gradle --version | grep '^Gradle' | head -1)"
echo " Node: $(node --version)"
echo " Android SDK: $ANDROID_HOME"
echo ""
echo "Build:"
echo " gradle :composeApp:desktopTest"
echo " gradle :composeApp:assembleDebug"
echo " gradle :composeApp:run"
echo " gradle :composeApp:wasmJsBrowserDevelopmentExecutableDistribution"
'';
}