Last active
December 4, 2017 00:53
-
-
Save pvdvreede/2da8984861ad9e30034744a10c444724 to your computer and use it in GitHub Desktop.
Arch Linux setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
set -eu | |
install_partition=$1 | |
# confirm we have internet | |
ping google.com | |
# make sure clock is up to date | |
timedatectl set-ntp true | |
# assuming standalone setup | |
mkdir -p /mnt/boot | |
mount /dev/$install_partition /mnt | |
mount /dev/sda1 /mnt/boot | |
# bootstrap the volume | |
pacstrap /mnt base | |
genfstab -U /mnt >> /mnt/etc/fstab | |
# We now need to run all following commands in chrooted installation | |
# How can we do that? | |
#arch-chroot /mnt | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
set -e | |
extras=$@ | |
function install-packages { | |
pacman --noconfirm --needed -S "$@" | |
} | |
# configure basics | |
echo 'en_AU.UTF-8 UTF-8' > /etc/locale.gen | |
locale-gen | |
localectl set-locale LANG=en_AU.UTF-8 | |
localectl set-keymap us | |
timedatectl set-timezone Australia/Melbourne | |
# upgrade system | |
cat << EOF > /etc/pacman.conf | |
[options] | |
Architecture = x86_64 | |
Color | |
TotalDownload | |
CheckSpace | |
VerbosePkgLists | |
[core] | |
Include = /etc/pacman.d/mirrorlist | |
[extra] | |
Include = /etc/pacman.d/mirrorlist | |
[community] | |
Include = /etc/pacman.d/mirrorlist | |
[multilib] | |
Include = /etc/pacman.d/mirrorlist | |
[archlinuxfr] | |
SigLevel = Never | |
Server = http://repo.archlinux.fr/\$arch | |
EOF | |
cat << EOF > /etc/pacman.d/mirrorlist | |
# Australia | |
Server = https://mirror.aarnet.edu.au/pub/archlinux/\$repo/os/\$arch | |
Server = http://mirror.internode.on.net/pub/archlinux/\$repo/os/\$arch | |
EOF | |
pacman --noconfirm -Syu | |
# yaourt | |
install-packages yaourt | |
if [[ $extras == *"macbook"* ]]; then | |
# laptop stuff | |
install-package tlp broadcom-wl-dkms xf86-video-ati | |
# prefer better battery life over performance of graphics | |
echo battery > /sys/class/drm/card0/device/power_dpm_state | |
# any macbook specific mods needed | |
# this is still interactive!!!! | |
yaourt -Sy linux-macbook | |
fi | |
if [[ $extras == *"gui"* ]]; then | |
# base xorg server stuff | |
install-packages xorg xorg-xinit | |
# Display manager | |
install-packages lightdm lightdm-gtk-greeter | |
systemctl enable lightdm.service | |
# Window manager | |
install-packages i3-wm i3status i3lock dmenu rxvt-unicode feh | |
# fonts | |
install-packages \ | |
adobe-source-code-pro-fonts \ | |
ttf-inconsolata \ | |
ttf-ubuntu-font-family | |
# Displays | |
install-packages arandr xorg-xbacklight | |
# Networking | |
install-packages \ | |
gnome-keyring \ | |
networkmanager \ | |
network-manager-applet \ | |
gnome-icon-theme \ | |
networkmanager-openvpn \ | |
networkmanager-openconnect \ | |
networkmanager-vpnc | |
systemctl enable NetworkManager.service | |
# Clipboard | |
install-packages parcellite | |
# Sound | |
install-packages pulseaudio pulseaudio-alsa ffmpeg pavucontrol alsa-utils | |
# web | |
install-packages chromium | |
fi | |
# tools and apps | |
install-packages git tmux vim tree gawk zsh docker docker-compose aws-cli |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment