---
dontChroot: true
timeout: 999

script:
    - "-rm -r ${ROOT}/home/${USER}/.config/alci-dwm"
    - "-rm ${ROOT}/etc/sudoers.d/g_wheel"
    - "-rm -r ${ROOT}/etc/mkinitcpio.conf.d/"
    - "-rm -r ${ROOT}/etc/systemd/system/getty@tty1.service.d"
    - "-rm -r ${ROOT}/etc/systemd/system/multi-user.target.wants/pacman-init.service"
    - "-rm -r ${ROOT}/etc/systemd/system/pacman-init.service"
    - "-rm ${ROOT}/etc/systemd/system/etc-pacman.d-gnupg.mount"
    - "-rm ${ROOT}/root/.automated_script.sh"
    - "-rm ${ROOT}/root/.zlogin"
    - "-rm ${ROOT}/etc/polkit-1/rules.d/49-nopasswd_global.rules"
    - "-rm ${ROOT}/etc/polkit-1/rules.d/49-nopasswd-calamares.rules"
    - "install -Dm755 /etc/calamares/modules/calamares-microcode-fix.sh ${ROOT}/root/calamares-microcode-fix.sh"
    - "chroot ${ROOT} /bin/bash /root/calamares-microcode-fix.sh"
    - "install -Dm755 /etc/calamares/modules/calamares-gpu-drivers.sh ${ROOT}/root/calamares-gpu-drivers.sh"
    - "chroot ${ROOT} /bin/bash /root/calamares-gpu-drivers.sh"
    - "-cp /etc/resolv.conf ${ROOT}/etc/resolv.conf"
    - "if [ -x ${ROOT}/usr/lib/raveos-gnome-theme/auto-apply.sh ]; then arch-chroot ${ROOT} /usr/lib/raveos-gnome-theme/auto-apply.sh; fi"
    - "if [ -x ${ROOT}/usr/lib/raveos-cosmic-theme/auto-apply.sh ]; then arch-chroot ${ROOT} /usr/lib/raveos-cosmic-theme/auto-apply.sh; fi"
    - "if [ -x ${ROOT}/usr/lib/raveos-plasma-theme/auto-apply.sh ]; then arch-chroot ${ROOT} /usr/lib/raveos-plasma-theme/auto-apply.sh; fi"
    - "if [ -x ${ROOT}/usr/lib/raveos-hyprland-theme/auto-apply.sh ]; then arch-chroot ${ROOT} /usr/lib/raveos-hyprland-theme/auto-apply.sh; fi"
    - "arch-chroot ${ROOT} /bin/bash -c 'pacman -Qi plasma-bigscreen &>/dev/null && pacman -Rcns --noconfirm plasma-bigscreen || true'"
    - "arch-chroot ${ROOT} sed -i '/^HOOKS=/ s/udev /udev plymouth /' /etc/mkinitcpio.conf"
    - "arch-chroot ${ROOT} mkinitcpio -P"
    - "install -Dm644 /etc/systemd/system/reflector-once.service ${ROOT}/etc/systemd/system/reflector-once.service"
    - "chroot ${ROOT} systemctl enable reflector-once.service"
    - "gsettings set org.gnome.desktop.interface gtk-theme 'Yaru-olive-dark'"
    - "gsettings set org.gnome.desktop.interface icon-theme 'Adwaitaru-olive'"