#!/bin/bash RAW=nvme0n1 DISK=${RAW}p CUSTOM_PACKAGES="nushell starship atuin helix sudo networkmanager efibootmgr openssh base-devel git" TIMEZONE="Europe/Amsterdam" HOSTNAME="luna" USERNAME="aviinl" # printf "Set password for ${USERNAME}: " # read -s PASSWORD # echo "" echo Creating Partitions on /dev/${RAW} parted /dev/${RAW} --fix --script \ mklabel gpt \ mkpart '"EFI System Partition"' fat32 4MiB 512MiB \ set 1 esp on \ mkpart '"Swap"' linux-swap 512MiB 8192MiB \ mkpart '"Root Filesystem"' ext4 8704MiB 100% \ type 3 4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709 || exit 1 mkswap /dev/${DISK}2 swapon --all --verbose echo Formatting /dev/${DISK}1 mkfs.fat -F 32 /dev/${DISK}1 || exit 1 echo Formatting /dev/${DISK}3 mkfs.ext4 /dev/${DISK}3 || exit 1 echo Mounting root at /mnt mount /dev/${DISK}3 /mnt || exit 1 echo Mounting boot at /mnt/boot mount --mkdir /dev/${DISK}1 /mnt/boot || exit 1 echo Initializing pacman pacman-key --init echo Installing base system pacstrap -K /mnt base linux linux-firmware ${CUSTOM_PACKAGES} || exit 1 echo Writing fstab genfstab -t PARTUUID /mnt >> /mnt/etc/fstab echo Configuring system echo Creating user account for ${USERNAME} arch-chroot /mnt useradd -mG wheel,video,input -s /usr/bin/nu -U ${USERNAME} # echo "${PASSWORD}" | passwd -R /mnt -s ${USERNAME} sed 's/# %wheel ALL=(ALL:ALL) NOPASSWD: ALL/%wheel ALL=(ALL:ALL) NOPASSWD: ALL/' /etc/sudoers > /mnt/etc/sudoers cat << EOF | arch-chroot /mnt ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime hwclock --systohc echo "en_US.UTF-8 UTF-8" > /etc/locale.gen locale-gen echo "LANG=en_US.UTF-8" > /etc/locale.conf echo "KEYMAP=us" > /etc/vconsole.conf echo "${HOSTNAME}" > /etc/hostname systemctl enable NetworkManager systemctl enable sshd mkdir -p /home/${USERNAME}/.config/{nushell,helix} chown -R 1000:1000 /home/${USERNAME}/.config su -c "starship init nu" ${USERNAME} > /home/${USERNAME}/.config/nushell/starship.nu su -c "atuin init nu" ${USERNAME} > /home/${USERNAME}/.config/nushell/atuin.nu # echo Installing yay package manager # pushd /root > /dev/null # git clone https://aur.archlinux.org/yay.git # pushd yay > /dev/null # makepkg -si # popd > /dev/null # rm -rf yay # popd > /dev/null EOF cat > /mnt/home/${USERNAME}/.config/nushell/config.nu < /mnt/home/${USERNAME}/.config/helix/config.toml <