nix-git/modules/waydroid.nix
2023-11-21 16:41:06 +01:00

88 lines
3.9 KiB
Nix

{ config, pkgs, ... }:
{
# Installation and Usage. https://nixos.wiki/wiki/WayDroid
#
# Installation:
# Initialize and fetch WayDroid images.
# sudo waydroid init
# # Alternatively, to have GApps support.
# sudo waydroid init -s GAPPS -f
# Un-root Waydroid.
# Discussion: https://github.com/waydroid/waydroid/issues/935
# Solution: https://github.com/waydroid/waydroid/issues/1060#issuecomment-1732325955 **and** https://github.com/waydroid/waydroid/issues/1060#issuecomment-1813789921
# Note: Check if `/var/lib/waydroid/waydroid_base.prop` still contains the added properties after some time.
# TODO: ARM Apps Incompatible
# https://wiki.archlinux.org/title/Waydroid#ARM_Apps_Incompatible
# https://www.reddit.com/r/NixOS/comments/15k2jxc/need_help_with_activating_libhoudini_for_waydroid/
# Startup:
# Start the WayDroid LXC container
# sudo systemctl start waydroid-container
# journalctl -b -u waydroid-container
# #=> Started Waydroid Container.
# Start WayDroid session
# waydroid session start
# # You'll know it is finished when you see the message "Android with user 0 is ready".
# Usage examples:
# Install and launch F-Droid
# curl -L -o ~/Downloads/F-Droid.apk https://f-droid.org/F-Droid.apk
# waydroid app install ~/Downloads/F-Droid.apk
# Install S-pushTAN
# # Requires Google Play services.
# # Aurora Store failed to launch ...
# # The old version installs without errors!
# waydroid app install ~/Downloads/com.starfinanz.mobile.android.pushtan_1.5.3-20033_arm64-v8a,armeabi-v7a,x86,x86_64_apkmirror.com.apk
# # The new version can't be installed without enabling ARM support ...
# # Manuall installation fails, but no error message was visible.
# waydroid app install ~/Downloads/com.starfinanz.mobile.android.pushtan_4.3.0-30106_arm64-v8a,armeabi-v7a_apkmirror.com.apk
# # Install by copying via adb did also fail.
# # https://docs.waydro.id/faq/using-adb-with-waydroid
# # Settings > About > IP
# adb connect <IP>:5555
# adb shell
# adb ls storage/emulated/0/Download/
# adb push ~/Downloads/com.starfinanz.mobile.android.pushtan_4.3.0-30106_apkmirror.com.apk storage/emulated/0/Download/pushtan.apk
# # Manually install from files app, gives error "App not installed".
# Launch some apps
# waydroid show-full-ui
# waydroid app list
# waydroid app launch org.fdroid.fdroid
# waydroid app launch com.aurora.store
# waydroid app launch com.starfinanz.mobile.android.pushtan
# Stop WayDroid session
# waydroid session stop
# Stop the Waydroid LXC container
# sudo systemctl stop waydroid-container
# Maintenance - Update Android
# sudo waydroid upgrade
# Cleanup
# https://wiki.archlinux.org/title/Waydroid#General_tips
# TODO: Webcam
# obs -> add v4l2 video captue -> log entry: info: v4l2-input: Found device 'HD Webcam: HD Webcam' at /dev/video0
# https://www.reddit.com/r/pop_os/comments/17ngh9h/how_to_make_cameravirtualcamera_working_on/
# Multiple issues, that camera does not work
# - https://github.com/waydroid/waydroid/issues/186
# - https://github.com/waydroid/waydroid/issues/170
# OBS virtual camera also doesnt work with v4l2loopback-dkms. https://github.com/waydroid/waydroid/issues/170#issuecomment-949719050#
# Some people write, that Open Camera works. https://github.com/waydroid/waydroid/issues/170#issuecomment-1237978646
# - https://github.com/waydroid/waydroid/issues/284
assertions = [{
assertion = config.services.xserver.displayManager.gdm.wayland;
message = "Waydroid requires Wayland.";
}];
virtualisation.waydroid.enable = true;
# Clipboard sharing. https://nixos.wiki/wiki/WayDroid#Clipboard_sharing
environment.systemPackages = with pkgs; [
wl-clipboard
];
}