FROM ghcr.io/ublue-os/bazzite-nvidia:latest

SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]

# Install packages from JSON
COPY build_files/packages.json /tmp/packages.json

RUN rpm-ostree install \
    $(jq -r '.packages[]' /tmp/packages.json) \
    steam \
    gamescope

# Copy system config (os-release)
COPY build_files/etc/ /etc/

# Copy branding (icons, wallpaper)
COPY usr/ /usr/

# Rename OS
RUN sed -i 's/Bazzite/KabOS/g' /usr/lib/os-release || true

# Create user
RUN useradd -m kabos

# Enable Steam session
RUN systemctl enable kabos-steam.service