#!/usr/bin/env bash
set -e

# focal, jammy, kinetic, lunar, bookworm, bullseye, sid
# UPSTREAM_CODENAME="bookworm"
UPSTREAM_CODENAME="trixie"

curl --progress-bar --proto '=https' --tlsv1.2 -Sf https://repo.waydro.id/waydroid.gpg --output /usr/share/keyrings/waydroid.gpg

echo "deb [signed-by=/usr/share/keyrings/waydroid.gpg] https://repo.waydro.id/ ${UPSTREAM_CODENAME} main" | tee /etc/apt/sources.list-available/waydroid.list

ln -sf /etc/apt/sources.list-available/waydroid.list /etc/apt/sources.list.d/waydroid.list

apt-get update && apt-get install -y waydroid

waydroid init

waydroid container start
