#!/bin/bash
echo 'type=83' | sudo sfdisk /dev/sda
mkfs.ext4 /dev/sda1
mount /dev/sda1 /mnt
pacstrap -K /mnt base linux networkmanager grub sudo # opendoas
# extra packages
pacstrap -K /mnt git base-devel fastfetch
# DE
pacstrap -K /mnt plasma-meta firefox konsole
# FSTAB
genfstab -U /mnt >> /mnt/etc/fstab
# more important stuff
arch-chroot /mnt /bin/bash <<EOF
grub-install /dev/sda --boot-directory=/boot
grub-mkconfig -o /boot/grub/grub.cfg
systemctl enable NetworkManager
systemctl enable sddm
useradd -mG wheel user
echo root:toor | chpasswd
echo user:user | chpasswd
echo "%wheel ALL=(ALL) ALL" > /etc/sudoers.d/99_wheel
echo "permit nopass root" > /etc/doas.conf
echo "permit nopass :wheel" > /etc/doas.conf
echo "sudo pacman -S --needed git base-devel && git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si" > /home/user/installyay.sh
chown user /home/user/installyay.sh
chmod 0777 /home/user/installyay.sh
echo "reboot please"
EOF
