#!/bin/bash
# ==============================================================================
# karch module: pacman_conf
# Phase 2 (chroot) — Add ILoveCandy to pacman.conf
# ==============================================================================

run_pacman_conf() {
    msg_info "Configuring pacman..."

    local conf="/etc/pacman.conf"

    if grep -q "^ILoveCandy" "$conf"; then
        msg_info "ILoveCandy already present in pacman.conf — skipping."
    else
        # Insert ILoveCandy after the [options] line
        sed -i '/^\[options\]/a ILoveCandy' "$conf"
        msg_ok "Added ILoveCandy to pacman.conf"
    fi

    dialog_msgbox "Pacman" "pacman.conf updated with ILoveCandy."

    return 0
}
