#!/usr/bin/enc bash
set -e
set -o pipefail

sudo apt install -y \
	incus \
	incus-tools \
	incus-client \
	incus-agent \
	dnsmasq-base

sudo incus admin init

# Add current user to admin for incus
sudo usermod -aG incus-admin $USERNAME

# https://linuxcontainers.org/incus/docs/main/howto/network_bridge_firewalld/#prevent-connectivity-issues-with-incus-and-docker

cat <<-EOF
	incus create images:centos/9-Stream centos --vm
	incus config device add centos agent disk source=agent:config
	incus start centos
EOF
