Back to workbench
/usr/bin/arch-setup

Arch-Setup

How I automate my Arch Linux setup so I can get back to coding faster.

As an Arch Linux user, I've had to reinstall my system more times than I'd like to admit. Sometimes it's because of a hardware swap, but usually it’s just me breaking things while experimenting. I got tired of spending hours manually configuring everything, so I finally sat down to build a "System as Code" setup.

The Problem with Fresh Installs

A fresh Arch install is basically just a blinking cursor. It takes forever to get back to a useful workstation. This setup is my attempt to automate the "boring" parts like installing AUR packages, symlinking dotfiles, and setting up core system services.

How I structured the scripts

I broke everything into modular Bash scripts to keep things from getting too messy:

  • packages.sh: Uses yay to install my core tools and AUR packages.
  • config.sh: Handles symlinking for Neovim, Kitty, and my shell aliases. It also sets up a Distrobox container for DaVinci Resolve so I can run it in a more stable environment.
  • services.sh: Just handles the background stuff I always forget to enable manually.

Robust-ish Automation

I tried to make the main install.sh script smart enough to track what failed so I don't have to restart the whole thing.

# A little trick I use to track failed packages export FAILED_PACKAGES=() export ACTIONS_TODO=() source scripts/helper.sh source scripts/packages.sh source scripts/config.sh if [ ${#FAILED_PACKAGES[@]} -gt 0 ]; then echo "Looks like some packages didn't install: ${FAILED_PACKAGES[@]}" fi

Future ideas

I’m planning to integrate more of my Hyprland configuration into this setup and maybe add some automatic backup logic using restic. It’s definitely a work in progress, but it’s already saved me a ton of time during my last "experimental" reinstall.