SERVICES=("ananicy-cpp" "systemd-resolved" )

post_install() {
    echo "Enabling services..."
    for service in "${SERVICES[@]}"; do
        systemctl enable "$service"
    done
    if command -v iw >/dev/null 2>&1; then
        systemctl enable cachyos-iw-set-regdomain.path
    fi
}

post_upgrade() {
    echo "Enabling services..."

    for service in "${SERVICES[@]}"; do
        if systemctl is-active "$service" >/dev/null; then
            systemctl restart "$service"
        fi
    done
    if systemctl is-active "systemd-oomd" >/dev/null; then
        systemctl disable systemd-oomd
    fi
    if command -v iw >/dev/null 2>&1; then
        systemctl enable cachyos-iw-set-regdomain.path
    fi
}
