#!/usr/bin/env bash
set -euxo pipefail

echo "🚀 Building KabOS NVIDIA Edition..."

# Fix GPG keys (safe)
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-* || true

# Clean metadata
rm -rf /var/cache/dnf || true

# Copy OS branding
cp -f /ctx/etc/os-release /etc/os-release || true

# 🚫 DO NOT INSTALL HERE
echo "⚠️ Skipping rpm-ostree install (not supported in Docker build)"

# Apply wallpaper
mkdir -p /usr/share/backgrounds
cp -f /ctx/usr/share/backgrounds/kabos.png /usr/share/backgrounds/kabos.png || true

# Refresh icons
gtk-update-icon-cache -f /usr/share/icons/hicolor || true

echo "✅ KabOS customization complete"