Can't start Android Studio emulators on NixOS

Recently I’ve switched to NixOS as my daily driver and I mainly do Android development.
to start, here is my current configuration:
https://github.com/abdallahmehiz/nix-config

My system configuration is:

  • I5 14400 @ 4.70GHz
  • 32GB of memory
  • 16GB of swap

I have attempted to follow the Android Nix Wiki but nothing on it worked for me.

My current issue is that every time I try to start an Android emulator through the Android Studio UI I am greeted with this error
image

these are the logs i get when starting Android Studio from android-studio and starting the emulator.

2025-03-12 00:40:47,875 [   4449]   WARN - #com.android.ddmlib - * daemon started successfully
2025-03-12 00:40:55,906 [  12480]   WARN - Emulator: Pixel Fold API 35 - Failed to process .ini file /home/abdallah/.config/.android/avd/../avd/Pixel_Fold_API_35.avd/quickbootChoice.ini for reading.
2025-03-12 00:40:58,268 [  14842]   WARN - Emulator: Pixel Fold API 35 - Emulator terminated with exit code 134
2025-03-12 00:40:58,768 [  15342]   WARN - #com.android.sdklib.deviceprovisioner.DeviceAction - The emulator process for AVD Pixel_Fold_API_35 has terminated.
com.android.tools.idea.avdmanager.EmulatorConnectionListener$EmulatorTerminatedException: The emulator process for AVD Pixel_Fold_API_35 has terminated.
	at com.android.tools.idea.avdmanager.EmulatorConnectionListener$WaitForEmulatorTask.run(EmulatorConnectionListener.java:93)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport$executeOnPooledThread$1.run(AnyThreadWriteThreadingSupport.kt:134)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at com.intellij.util.concurrency.ContextCallable.call(ContextCallable.java:32)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Unknown Source)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

Found out that, in my Hyprland config i had QT_QPA_PLATFORM set to wayland, which for some reason the emulator didn’t like.
Setting it to xcb instead worked.