Running Waydroid on NixOS using X11
Overview
Packages
- weston - Wayland compositor
NixOS Configuration
virtualisation = {
waydroid = {
enable = true;
};
};
environment.systemPackages = with pkgs; [weston];
Initialize Waydroid
This downloads the LineageOS image and installs it
# Fetch WayDroid images.
# You can add the parameters "-s GAPPS -f" to have GApps support.
sudo waydroid init
Start Waydroid
Open the terminal and start the waydroid container
sudo systemctl start waydroid-container
Check status of container
sudo journalctl -u waydroid-container
Open terminal and start weston
weston
In the weston window, open a terminal and start Waydroid sesson in the background
waydroid session start &
Start the UI
waydroid show-full-ui
Stop Waydroid
Close weston window
Stop waydroid container
sudo systemctl stop waydroid-container
Remove user data
Only do this if you don't want to persist anything from that container
# Removing images and user data
sudo rm -r /var/lib/waydroid/* ~/.local/share/waydroid
Update Android
sudo waydroid upgrade
General Usage
# Start Android UI
waydroid show-full-ui
# List Android apps
waydroid app list
# Start an Android app
waydroid app launch <application name>
# Install an Android app
waydroid app install </path/to/app.apk>
# Enter the LXC shell
sudo waydroid shell
# Overrides the full-ui width
waydroid prop set persist.waydroid.width 608