2026-02-10 17:20:39 +01:00
#!/bin/bash
read -p "Hostname: " HOSTNAME
read -p "Username: " USERNAME
read -sp "User password: " PASS
read -sp "ROOT PASSWORD: " ROOT_PASS
read -sp "LUKS Passphrase: " LUKS_PASS
read -p "Main partition: " PART
parted -s " $PART " mklabel gpt
parted -s " $PART " mkpart primary fat32 1MiB 3GB
parted -s " $PART " set 1 esp on
parted -s " $PART " mkpart primary linux-swap 3GB 27GB
parted -s " $PART " mkpart primary ext4 27GB 100%
2026-02-13 22:54:42 +01:00
PART_BOOT = " ${ PART } 1 "
PART_SWAP = " ${ PART } 2 "
PART_ROOTHOME = " ${ PART } 3 "
2026-02-10 17:20:39 +01:00
2026-02-10 20:44:52 +01:00
echo -n " $LUKS_PASS " | cryptsetup luksFormat --type luks2 --iter-time 5000 " ${ PART_ROOTHOME } "
echo -n " $LUKS_PASS " | cryptsetup open " ${ PART_ROOTHOME } " roothome
mkfs.fat -F 32 " ${ PART_BOOT } "
2026-02-10 17:27:58 +01:00
mkfs.ext4 /dev/mapper/roothome
2026-02-10 20:44:52 +01:00
mkswap " ${ PART_SWAP } "
2026-02-10 17:27:58 +01:00
mount /dev/mapper/roothome /mnt
mkdir -p /mnt/boot
2026-02-10 20:44:52 +01:00
mount " ${ PART_BOOT } " /mnt/boot
swapon " ${ PART_SWAP } "
2026-02-10 17:27:58 +01:00
2026-02-10 22:06:43 +00:00
pacman -Sy archlinux-keyring
2026-02-10 17:20:39 +01:00
pacstrap /mnt base linux linux-firmware
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt /bin/bash <<EOF
ln -sf /usr/share/zoneinfo/Area/Location /etc/localtime
hwclock --systohc
echo " $HOSTNAME " >> /etc/hostname
2026-02-10 17:43:38 +01:00
echo "KEYMAP=trq" >> /etc/vconsole.conf
2026-02-10 17:20:39 +01:00
2026-02-10 20:17:29 +01:00
pacman -S --noconfirm base-devel sudo
2026-02-13 23:15:36 +01:00
pacman -S --noconfirm networkmanager alsa-utils bluez bluez-utils nvidia-open nvidia-utils pavucontrol pipewire pipewire-alsa pipewire-pulse polkit-gnome usbutils sof-firmware
2026-02-10 20:44:52 +01:00
pacman -S --noconfirm alacritty firefox eog flameshot keepassxc ly sway swaybg zip unzip ttf-jetbrains-mono i3status
2026-02-13 21:21:29 +01:00
pacman -S --noconfirm ufw clamav opensnitch firejail
2026-02-10 17:20:39 +01:00
2026-02-13 21:54:44 +01:00
pacman -S --noconfirm cmake cloc vim emacs cups docker docker-compose efibootmgr gdb ghidra ghostscript git git-lfs man-db man-pages mkcert nasm net-tools openssh qemu-base qemu-full dnsmasq dmidecode rustup valgrind virt-manager virt-viewer wireplumber wireguard-tools wireshark-qt wmenu wofi xdg-desktop-portal-gtk xdg-desktop-portal-wlr xorg-xwayland pyright clang iproute2
2026-02-10 17:20:39 +01:00
2026-02-13 21:21:29 +01:00
systemctl enable clamav-freshclam.service
systemctl enable clamav-daemon.service
systemctl enable clamav-clamonacc.service
systemctl enable opensnitchd
2026-02-10 17:20:39 +01:00
systemctl enable NetworkManager
systemctl enable ufw
systemctl enable clamav-daemon
2026-02-10 18:57:16 +01:00
systemctl disable getty@tty0.service
2026-02-10 19:45:05 +01:00
systemctl disable getty@tty1.service
systemctl enable ly@tty1.service
2026-02-10 17:20:39 +01:00
ufw default deny incoming
ufw default allow outgoing
ufw enable
2026-02-10 19:14:11 +01:00
sed -i 's/HOOKS=(base systemd autodetect microcode modconf kms keyboard keymap sd-vconsole block filesystems fsck)/HOOKS=(base systemd autodetect microcode modconf kms keyboard keymap sd-vconsole block sd-encrypt filesystems fsck)/' /etc/mkinitcpio.conf
2026-02-10 17:20:39 +01:00
mkinitcpio -P
2026-02-13 21:21:29 +01:00
printf "Configuring yay..."
git clone https://aur.archlinux.org/yay.git /tmp/yay
cd /tmp/yay && makepkg -si
printf "Installing yay packages"
yay -S ttf-ms-fonts
2026-02-13 21:29:09 +01:00
printf "Configure ClamAV OnAccess"
printf " OnAccessIncludePath /home/ $USERNAME /\nOnAccessIncludePath /home/ $USERNAME /\nOnAccessPrevention yes\nTemporaryDirectory /clamav/tmp " | tee -a /etc/clamav/clamd.conf
sed -i '/^ExecStart=/ s/$/ --fdpass/' /etc/systemd/system/clamav-onacc.service
2026-02-10 19:45:05 +01:00
printf "Configuring users..."
2026-02-10 18:57:16 +01:00
echo -n " root: $ROOT_PASS " | chpasswd
2026-02-10 19:45:05 +01:00
useradd -m -G wheel,docker,libvirt,video,audio " $USERNAME "
2026-02-10 20:17:29 +01:00
sed -i 's/^# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers
2026-02-10 19:45:05 +01:00
2026-02-10 20:17:29 +01:00
su - " $USERNAME " -c " git clone https://universe.0xinfinity.dev/0x221E/dotfiles.git /home/ $USERNAME /dotfiles "
2026-02-10 19:49:41 +01:00
2026-02-10 20:17:29 +01:00
su - " $USERNAME " -c " mkdir -p /home/ $USERNAME /.config "
su - " $USERNAME " -c " cp -sr /home/ $USERNAME /dotfiles/* /home/ $USERNAME /.config/ "
2026-02-10 19:49:41 +01:00
2026-02-10 20:17:29 +01:00
echo " $USERNAME : $PASS " | chpasswd
2026-02-10 17:20:39 +01:00
bootctl install
2026-02-10 19:14:11 +01:00
printf "default arch.conf\ntimeout 3\nconsole-mode max\neditor no" >> /boot/loader/loader.conf
2026-02-10 17:20:39 +01:00
2026-02-10 20:44:52 +01:00
UUID = \$ ( blkid -s UUID -o value " ${ PART_ROOTHOME } " )
2026-02-10 17:20:39 +01:00
2026-02-10 20:17:29 +01:00
printf "title Arch Linux\nlinux /vmlinuz-linux\ninitrd /initramfs-linux.img\noptions rd.luks.name=\$UUID=roothome root=/dev/mapper/roothome rw" > /boot/loader/entries/arch.conf
2026-02-10 17:20:39 +01:00
EOF