diff options
Diffstat (limited to 'install.sh')
-rw-r--r-- | install.sh | 65 |
1 files changed, 51 insertions, 14 deletions
@@ -6,22 +6,27 @@ source deploy.conf | |||
6 | # Change apt sources to use https | 6 | # Change apt sources to use https |
7 | sed -i "s/http/https/" /etc/apt/sources.list | 7 | sed -i "s/http/https/" /etc/apt/sources.list |
8 | 8 | ||
9 | [ -n $BACKPORTS ] && echo "deb https://deb.debian.org/debian/ bullseye-backports main" >> \ | ||
10 | /etc/apt/sources.list | ||
11 | |||
9 | # Update packages | 12 | # Update packages |
10 | apt update -y && apt upgrade -y | 13 | apt update -y && apt upgrade -y |
11 | 14 | ||
12 | if [ -n "$DESKTOP" ] then; | 15 | # Temporarily add contrib and non-free repos for necessary proprietary firmware and microcode |
13 | # Temporarily add contrib and non-free repos | 16 | sed -i "s/main/main contrib non-free/" /etc/apt/sources.list |
14 | sed -i "s/main/main contrib non-free/" /etc/apt/sources.list | 17 | apt update -y |
15 | apt update -y | 18 | |
16 | # Install required non-free packages | 19 | [ -n $AMDCPU ] && apt install amd64-microcode -y |
17 | apt install amd64-microcode firmware-amd-graphics | 20 | [ -n $AMDGPU ] && apt install firmware-amd-graphics -y |
18 | # Remove non-free repos | 21 | [ -n $INTELCPU ] && apt install intel-microcode -y |
19 | sed -i "s/main contrib non-free/main/" /etc/apt/sources.list | ||
20 | apt update -y | ||
21 | fi | ||
22 | 22 | ||
23 | # Install packages - do not install recommendations | 23 | # Remove contrib and non-free repos |
24 | apt install "$(cat packages)" -y | 24 | sed -i "s/main contrib non-free/main/" /etc/apt/sources.list |
25 | apt update -y | ||
26 | |||
27 | # Install packages | ||
28 | apt install "$(cat packages.base)" -y | ||
29 | apt install "$(cat packages.custom)" -y | ||
25 | 30 | ||
26 | # basic configuration of ufw | 31 | # basic configuration of ufw |
27 | ufw default deny incoming | 32 | ufw default deny incoming |
@@ -38,8 +43,40 @@ su $user | |||
38 | passwd -l root | 43 | passwd -l root |
39 | 44 | ||
40 | # Get and deploy dotfiles | 45 | # Get and deploy dotfiles |
46 | echo "backing up current home directory to ~/home_backup" | ||
47 | rsync -av $HOME/ $HOME/home_backup/ | ||
41 | cd $HOME | 48 | cd $HOME |
42 | git clone https://git.chudnick.com/dotfiles.git | 49 | git clone https://git.chudnick.com/dotfiles.git |
43 | cd dotfiles | 50 | rsync --exclude .git/ --exclude LICENSE -av $HOME/dotfiles/ $HOME |
44 | mv * ../ | 51 | chsh -s $(which zsh) $USER |
52 | |||
53 | # DWM | ||
54 | if [ -n $DWM ] then; | ||
55 | mkdir -p $HOME/.local/src/ | ||
56 | cd $HOME/.local/src/ | ||
57 | sudo apt install libx11-dev libx11-xcb-dev libxcb-res0-dev libxft-dev libxinerama-dev -y | ||
58 | git clone https://git.chudnick.com/dwm | ||
59 | cd dwm | ||
60 | sudo make install | ||
61 | cd $HOME | ||
62 | fi | ||
63 | |||
64 | # DWMBLOCKS | ||
65 | if [ -n $DWMBLOCKS ] then; | ||
66 | mkdir -p $HOME/.local/src/ | ||
67 | cd $HOME/.local/src/ | ||
68 | sudo apt install libx11-dev -y | ||
69 | git clone https://git.chudnick.com/dwmblocks | ||
70 | cd dwmblocks | ||
71 | sudo make install | ||
72 | cd $HOME | ||
73 | fi | ||
74 | |||
75 | # SSH | ||
76 | [ -n $CONFIG_SSH ] && ssh-keygen | ||
77 | |||
78 | # SSH SERVER | ||
79 | [ -n $CONFIG_SSH_SERVER ] && sudo apt install openssh-server -y && sudo ufw allow ssh | ||
45 | 80 | ||
81 | # GPG | ||
82 | [ -n $CONFIG_GPG ] && gpg --full-gen-key | ||