- Introduction
- Installation Steps
- Challenges Faced
- Reasons for Using WayDroid
- Rebuilding with Nix Flakes
WayDroid is an application that uses LXC containers to run Android applications on a non-Android system. This document outlines the steps I took to install WayDroid on NixOS, the challenges I faced, and the reasons for choosing WayDroid.
To enable WayDroid in your NixOS configuration, add the following line to your /etc/nixos/configuration.nix file:
{
virtualisation.waydroid.enable = true;
}Rebuild your NixOS configuration and switch to the new configuration:
sudo nixos-rebuild switchIn your shell, fetch WayDroid images. To include Google Apps (GApps) support, add the parameters -s GAPPS -f:
sudo waydroid initWayDroid requires a Wayland desktop session and cannot be directly used on X11. I had to set up a nested Wayland session using tools like cage.
For my NVIDIA GPU, I needed to disable GBM and mesa-drivers by modifying /var/lib/waydroid/waydroid_base.prop:
ro.hardware.gralloc=default
ro.hardware.egl=swiftshaderWayDroid allows running Android applications seamlessly on a non-Android system, providing access to a wide range of apps.
WayDroid integrates well with NixOS, leveraging the power of Nix’s declarative configuration management.
Ensure Nix flakes are enabled by adding the following to your /etc/nixos/configuration.nix:
{
nix.settings.experimental-features = [ "nix-command" "flakes" ];
}Rebuild your NixOS configuration using flakes:
nixos-rebuild switch --flake .sudo systemctl start waydroid-containerConfirm the container has started:
sudo journalctl -u waydroid-containerStart the WayDroid session:
waydroid session startwaydroid show-full-uiwaydroid app listwaydroid app launch <application name>waydroid app install </path/to/app.apk>sudo waydroid shellwaydroid prop set persist.waydroid.width 608sudo waydroid upgradesudo systemctl stop waydroid-container
sudo rm -r /var/lib/waydroid/* ~/.local/share/waydroidFor NVIDIA or RX 6800 series GPUs:
ro.hardware.gralloc=default
ro.hardware.egl=swiftshaderEnable memfd:
sys.use_memfd=trueChanging the keyboard layout is currently not supported.
Android might fail to display special characters correctly.
Stop the Android session and container to suspend correctly.
Add wl-clipboard to environment.systemPackages.
For more detailed information, refer to the WayDroid article on the Archlinux Wiki.
