Skip to content

Instantly share code, notes, and snippets.

@psosera
Created November 2, 2021 00:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save psosera/e54c9978741619e230bb51eaed4146c1 to your computer and use it in GitHub Desktop.
Save psosera/e54c9978741619e230bb51eaed4146c1 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Set the time
timedatectl set-ntp true
# Partition disk
parted /dev/sda mklabel msdos
parted /dev/sda mkpart primary linux-swap 1MiB 8GiB
parted /dev/sda mkpart primary ext4 8GiB 100%
parted /dev/sda set 2 boot on
# Format partitions
mkswap /dev/sda1
mkfs.ext4 /dev/sda2
# Mount file systems
swapon /dev/sda1
mount /dev/sda2 /mnt
# Install Archlinux
pacstrap /mnt base linux linux-firmware
genfstab -U /mnt >> /mnt/etc/fstab
# Chroot into the new system
arch-chroot /mnt
# Set the timezone
ln -sf /usr/share/zoneinfo/America/Chicago /etc/localtime
hwclock --systohc
# Set localization
cat > /etc/locale.gen << EOF
en_US.UTF-8 UTF-8
EOF
locale-gen
cat > /etc/locale.conf << EOF
LANG=en_US.UTF_8
EOF
# Set hostname
cat > /etc/hostname << EOF
$1
EOF
# Install base packages
pacman -S --noconfirm \
dhcpcd \
gcc \
git \
grub \
intel-ucode \
iproute2 \
make \
myrepos \
neovim \
openssh \
pandoc \
rsync \
sudo \
tailscale \
texlive-full \
tmux \
vi \
wget \
yadm \
zsh
# Enable networking
systemctl enable sshd.service
systemctl enable tailscaled.service
# Setup bootloader
grub-install --target=i386-pc /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
# Set root password
passwd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment