-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
70 lines (56 loc) · 2.13 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
USER='rev'
HOSTNAME='$1.revthefox.co.uk'
# Set a nice hostname
echo $HOSTNAME > /etc/hostname
# Update packages
pacman -Syyu
# Install base packages
echo 'Installing base packages'
yes | pacman -S base-devel tmux zsh wget curl dnsutils traceroute htop lsof strace sudo ca-certificates
# Enable multilib
echo 'Enabling multilib repos...'
cp /etc/pacman.conf /etc/pacman.conf.backup
echo '# Generated by install script' >> /etc/pacman.conf
echo '[multilib]' >> /etc/pacman.conf
echo 'Include = /etc/pacman.d/mirrorlist' >> /etc/pacman.conf
# Update again, for multilib
yes | pacman -Syyu
# Google DNS
echo 'Adding Google DNS to /etc/resolv.conf'
echo 'nameserver 8.8.8.8' > /etc/resolv.conf
echo 'nameserver 8.8.4.4' >> /etc/resolv.conf
# Install fonts
echo 'Installing TTF fonts (could take a while)'
yes | pacman -S $(pacman -Ssq ttf-)
# Set locale
echo 'Setting locale'
echo -e 'en_US.UTF-8 UTF-8\nen_US ISO-8859-1\nen_GB.UTF-8 UTF-8\nen_GB ISO-8859-1' > /etc/locale.gen
locale-gen
echo 'LANG="en_GB.UTF-8"' > /etc/locale.conf
# Create non-root user
echo 'Adding non-root user ($USER)...'
useradd -m -G wheel -s /bin/zsh $USER
echo 'Password for user $USER: '
read PASSWD
echo -e "$PASSWD\n$PASSWD" | (passwd --stdin $USER)
# Add myself to sudo
echo 'Adding user "$USER" to sudoers'
echo '$USER ALL=(ALL) ALL' >> /etc/sudoers
# Add SSH key
echo 'Adding SSH key to $USER'
mkdir -p /home/$USER/.ssh
wget https://raw.github.com/TheReverend403/arch-install-scripts/master/id_rsa.pub -O /home/$USER/.ssh/authorized_keys
chown -R $USER /home/$USER/.ssh
# Install ohmyzsh
echo 'Installing oh-my-zsh'
git clone git://github.com/robbyrussell/oh-my-zsh.git /home/$USER/.oh-my-zsh
cp /home/$USER/.oh-my-zsh/templates/zshrc.zsh-template /home/$USER/.zshrc
sed -i s/robbyrussell/blinks/g /home/$USER/.zshrc
chown -R $USER /home/$USER/.oh-my-zsh
chown -R $USER /home/$USER/.zshrc
# Add custom tmux settings
echo 'Adding custom tmux settings'
wget https://raw.github.com/TheReverend403/arch-install-scripts/master/tmux.conf -O /home/$USER/.tmux.conf
chown -R $USER /home/$USER/.tmux.conf
echo 'Setup complete. Remember to reboot to fully enable locale/font changes.'