<commit_before>#!/bin/bash

### Get user input variables
source arch-installer/user-input.txt

### Nicer formatting for pacstrap
sed -i 's/#Color/Color/g' /etc/pacman.conf
sed -i 's/#TotalDownload/TotalDownload/g' /etc/pacman.conf

### Update mirrorlist
reflector --verbose --latest 40 --sort rate --protocol https --save /etc/pacman.d/mirrorlist

### Setup Package List
echo " >> Creating package list"


#---------------------------------------------------------
#---------------------------------------------------------

packages_developer="cmake gnuplot boost eigen ocl-icd opencl-headers openmpi hdf5-cpp-fortran python-pip ipython python-h5py python-scipy python-matplotlib python-pillow python-pylint tree"
packages_full="$packages_developer texlive-most texlive-lang doxygen graphviz"

packages_desktop_developer_nogui=$packages_developer
packages_desktop_developer_gui="$packages_developer yakuake chromium"
packages_desktop_full_nogui=$packages_full
packages_desktop_full_gui="$packages_desktop_developer_gui texstudio filezilla qtox thunderbird  gimp inkscape vlc teamspeak3 owncloud-client"

packages_server_developer_nogui=$packages_developer
packages_server_developer_gui="$packages_developer yakuake chromium"
packages_server_full_nogui=$packages_full
packages_server_full_gui="$packages_server_developer_gui texstudio"


### System, Packages and Desktop
packages_user=""
case $USER_SYSTEM in
    "desktop") 
    case $USER_PACKAGES in
        "full") 
        case $USER_DESKTOP in
            "none") 
            packages_user=$packages_desktop_full_nogui
            break;;

            "kde plasma") 
            packages_user="plasma sddm kde-applications $packages_desktop_full_gui"
            break;;

        * ) echo "Invalid USER_DESKTOP. Try again..."
            exit 1
        esac
        break;;

        "developer") 
        case $USER_DESKTOP in
            "none") 
            packages_user=$packages_desktop_developer_nogui
            break;;

            "kde plasma") 
            packages_user="plasma sddm kde-applications $packages_desktop_developer_gui"
            break;;

        * ) echo "Invalid USER_DESKTOP. Try again..."
            exit 1
        esac
        break;;

        "minimal") 
        case $USER_DESKTOP in
            "none") 
            packages_user=""
            break;;

            "kde plasma") 
            packages_user="plasma sddm kde-applications"
            break;;

        * ) echo "Invalid USER_DESKTOP. Try again..."
            exit 1
        esac
        break;;

    * ) echo "Invalid USER_PACKAGES. Try again..."
        exit 1
    esac
    break;;

    "server") 
    case $USER_PACKAGES in
        "full") 
        case $USER_DESKTOP in
            "none") 
            packages_user=$packages_server_full_nogui
            break;;

            "kde plasma") 
            packages_user="plasma sddm kde-applications $packages_server_full_gui"
            break;;

        * ) echo "Invalid USER_DESKTOP. Try again..."
            exit 1
        esac
        break;;

        "developer") 
        case $USER_DESKTOP in
            "none") 
            packages_user=$packages_server_developer_nogui
            break;;

            "kde plasma") 
            packages_user="plasma sddm kde-applications $packages_server_developer_gui"
            break;;

        * ) echo "Invalid USER_DESKTOP. Try again..."
            exit 1
        esac
        break;;

        "minimal") 
        case $USER_DESKTOP in
            "none") 
            packages_user=""
            break;;

            "kde plasma") 
            user_packages="plasma sddm kde-applications"
            break;;

        * ) echo "Invalid USER_DESKTOP. Try again..."
            exit 1
        esac
        break;;

    * ) echo "Invalid USER_PACKAGES. Try again..."
        exit 1
    esac
    break;;

* ) echo "Invalid USER_SYSTEM. Try again..."
    exit 1
esac

### Graphics
packages_graphics=""
case $USER_GRAPHICS in
    "default") 
    packages_graphics="mesa mesa-libgl xf86-video-vesa opencl-mesa"
    break;;

    "intel") 
    packages_graphics="mesa mesa-libgl xf86-video-intel opencl-mesa"
    break;;

    "nvidia") 
    packages_graphics="nvidia nvidia-libgl opencl-nvidia"
    break;;

    "amd") 
    packages_graphics="mesa mesa-libgl xf86-video-vesa opencl-mesa"
    break;;

    "vbox") 
    packages_graphics="virtualbox-guest-modules-arch virtualbox-guest-utils opencl-mesa"
    break;;

* ) echo "Invalid USER_GRAPHICS. Try again..."
    exit 1
esac
#---------------------------------------------------------
#---------------------------------------------------------


### AUR packages dependencies
# yaourt needs yajl
# vs code needs gconf
# aura-bin needs abs
# AUR_DEPENDENCIES="gconf yajl abs"
# AUR_DEPENDENCIES="gconf abs"
AUR_DEPENDENCIES="abs"

### Install packages
echo " >> Going to install arch packages"
pacstrap /mnt base base-devel intel-ucode \
              sudo wget openssh git vim zsh powerline-fonts archiso p7zip unrar xclip fortune-mod \
              $packages_user $packages_graphics abs
echo " >> Installed arch packages"

### Nicer formatting for pacstrap on installed
sed -i 's/#Color/Color/g' /mnt/etc/pacman.conf
sed -i 's/#TotalDownload/TotalDownload/g' /mnt/etc/pacman.conf


# Maybe later:
#   wpa_supplicant
#   nettle
<commit_msg>Added package reflector.<commit_after>#!/bin/bash

### Get user input variables
source arch-installer/user-input.txt

### Nicer formatting for pacstrap
sed -i 's/#Color/Color/g' /etc/pacman.conf
sed -i 's/#TotalDownload/TotalDownload/g' /etc/pacman.conf

### Update mirrorlist
reflector --verbose --latest 40 --sort rate --protocol https --save /etc/pacman.d/mirrorlist

### Setup Package List
echo " >> Creating package list"


#---------------------------------------------------------
#---------------------------------------------------------

packages_developer="cmake gnuplot boost eigen ocl-icd opencl-headers openmpi hdf5-cpp-fortran python-pip ipython python-h5py python-scipy python-matplotlib python-pillow python-pylint tree"
packages_full="$packages_developer texlive-most texlive-lang doxygen graphviz"

packages_desktop_developer_nogui=$packages_developer
packages_desktop_developer_gui="$packages_developer yakuake chromium"
packages_desktop_full_nogui=$packages_full
packages_desktop_full_gui="$packages_desktop_developer_gui texstudio filezilla qtox thunderbird  gimp inkscape vlc teamspeak3 owncloud-client"

packages_server_developer_nogui=$packages_developer
packages_server_developer_gui="$packages_developer yakuake chromium"
packages_server_full_nogui=$packages_full
packages_server_full_gui="$packages_server_developer_gui texstudio"


### System, Packages and Desktop
packages_user=""
case $USER_SYSTEM in
    "desktop") 
    case $USER_PACKAGES in
        "full") 
        case $USER_DESKTOP in
            "none") 
            packages_user=$packages_desktop_full_nogui
            break;;

            "kde plasma") 
            packages_user="plasma sddm kde-applications $packages_desktop_full_gui"
            break;;

        * ) echo "Invalid USER_DESKTOP. Try again..."
            exit 1
        esac
        break;;

        "developer") 
        case $USER_DESKTOP in
            "none") 
            packages_user=$packages_desktop_developer_nogui
            break;;

            "kde plasma") 
            packages_user="plasma sddm kde-applications $packages_desktop_developer_gui"
            break;;

        * ) echo "Invalid USER_DESKTOP. Try again..."
            exit 1
        esac
        break;;

        "minimal") 
        case $USER_DESKTOP in
            "none") 
            packages_user=""
            break;;

            "kde plasma") 
            packages_user="plasma sddm kde-applications"
            break;;

        * ) echo "Invalid USER_DESKTOP. Try again..."
            exit 1
        esac
        break;;

    * ) echo "Invalid USER_PACKAGES. Try again..."
        exit 1
    esac
    break;;

    "server") 
    case $USER_PACKAGES in
        "full") 
        case $USER_DESKTOP in
            "none") 
            packages_user=$packages_server_full_nogui
            break;;

            "kde plasma") 
            packages_user="plasma sddm kde-applications $packages_server_full_gui"
            break;;

        * ) echo "Invalid USER_DESKTOP. Try again..."
            exit 1
        esac
        break;;

        "developer") 
        case $USER_DESKTOP in
            "none") 
            packages_user=$packages_server_developer_nogui
            break;;

            "kde plasma") 
            packages_user="plasma sddm kde-applications $packages_server_developer_gui"
            break;;

        * ) echo "Invalid USER_DESKTOP. Try again..."
            exit 1
        esac
        break;;

        "minimal") 
        case $USER_DESKTOP in
            "none") 
            packages_user=""
            break;;

            "kde plasma") 
            user_packages="plasma sddm kde-applications"
            break;;

        * ) echo "Invalid USER_DESKTOP. Try again..."
            exit 1
        esac
        break;;

    * ) echo "Invalid USER_PACKAGES. Try again..."
        exit 1
    esac
    break;;

* ) echo "Invalid USER_SYSTEM. Try again..."
    exit 1
esac

### Graphics
packages_graphics=""
case $USER_GRAPHICS in
    "default") 
    packages_graphics="mesa mesa-libgl xf86-video-vesa opencl-mesa"
    break;;

    "intel") 
    packages_graphics="mesa mesa-libgl xf86-video-intel opencl-mesa"
    break;;

    "nvidia") 
    packages_graphics="nvidia nvidia-libgl opencl-nvidia"
    break;;

    "amd") 
    packages_graphics="mesa mesa-libgl xf86-video-vesa opencl-mesa"
    break;;

    "vbox") 
    packages_graphics="virtualbox-guest-modules-arch virtualbox-guest-utils opencl-mesa"
    break;;

* ) echo "Invalid USER_GRAPHICS. Try again..."
    exit 1
esac
#---------------------------------------------------------
#---------------------------------------------------------


### AUR packages dependencies
# yaourt needs yajl
# vs code needs gconf
# aura-bin needs abs
# AUR_DEPENDENCIES="gconf yajl abs"
# AUR_DEPENDENCIES="gconf abs"
AUR_DEPENDENCIES="abs"

### Install packages
echo " >> Going to install arch packages"
pacstrap /mnt base base-devel intel-ucode \
              sudo wget openssh git vim zsh powerline-fonts archiso p7zip unrar xclip fortune-mod reflector \
              $packages_user $packages_graphics abs
echo " >> Installed arch packages"

### Nicer formatting for pacstrap on installed
sed -i 's/#Color/Color/g' /mnt/etc/pacman.conf
sed -i 's/#TotalDownload/TotalDownload/g' /mnt/etc/pacman.conf


# Maybe later:
#   wpa_supplicant
#   nettle

{'fraction_non_alphanumeric': 0.1322583651784882, 'fraction_numerical': 0.004101034579177929, 'mean_word_length': 2.0578512396694215, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4484869', 'n_tokens_mistral': 3346, 'n_tokens_neox': 3091, 'n_words': 741}