helm/os/+arch/install

66 lines
1.5 KiB
Plaintext
Raw Normal View History

#!/usr/bin/env bash
2016-10-19 07:56:37 -07:00
# Provisions arch linux. Should be run from a non-root user, after the bootstrap
# script (and reboot).
2017-04-25 16:55:02 -07:00
set -e
2016-10-19 07:56:37 -07:00
PWD=$(dirname $0)
pacman='sudo pacman --needed --noconfirm'
pacaur='pacaur --needed --noconfirm'
2016-11-15 12:48:06 -08:00
exists() { command -v "$1" >/dev/null; }
2016-11-15 12:48:06 -08:00
########################################
#
# Bootstrap
#
########################################
if ! ping -c1 google.com >/dev/null; then
2016-11-15 12:48:06 -08:00
>&2 echo "No internet connection detected!"
exit 1
elif [[ $(id -u) == 0 ]]; then
>&2 echo "Should not be run as root!"
exit 2
2016-11-15 12:48:06 -08:00
fi
# Essential utilities
$pacman -S wget git curl tree rsync openssh dnsutils
2016-11-15 12:48:06 -08:00
# Set up pacaur (AUR helper)
if ! exists pacaur; then
pushd $(mktemp -d)
curl -o PKGBUILD https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=cower && makepkg --skippgpcheck -sri
curl -o PKGBUILD https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=pacaur && makepkg --skippgpcheck -sri
TEMP=$(pwd)
popd
rm -rf "$TEMP"
if ! exists pacaur; then
>&2 echo "Pacaur wasn't successfully installed"
exit 3
fi
fi
## Bootstrap
# Helpful utilities
$pacaur -S the_silver_searcher tmux hub bc keybase-bin
if [[ -z $SERVER ]]; then
2016-12-16 20:11:35 -08:00
# desktop essentials
$pacaur -S \
xorg-xinit xorg-server \
lightdm lightdm-webkit2-greeter \
bspwm sxhkd compton \
xcb-proto polybar \
dunst libnotify \
feh sxiv maim slop-opengl neofetch-git pass youtube-dl xdotool \
redshift firefox \
alsa-utils \
dictd dict-gcide
2016-11-15 12:48:06 -08:00
fi