From 3e7271645731d7bf51c1b186846861f9b80902b2 Mon Sep 17 00:00:00 2001 From: Sam Chudnick Date: Sun, 26 Dec 2021 15:26:09 -0500 Subject: Added several more options. Removed desktop option and replaced with hardware specific options. Use rsync to deploy files instead of mv. --- deploy.conf | 10 +++++++++- install.sh | 65 ++++++++++++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 60 insertions(+), 15 deletions(-) diff --git a/deploy.conf b/deploy.conf index 64c97ae..c40a12f 100644 --- a/deploy.conf +++ b/deploy.conf @@ -2,6 +2,14 @@ # # Configuration file for deployment script -#$DESKTOP=1 +#$BACKPORTS=1 +#$AMDCPU=1 +#$INTELCPU=1 +#$AMDGPU=1 #$APTOPTS="--no-install-recommends" +#$DWM=1 +#$DWMBLOCKS=1 +#$CONFIG_SSH=1 +#$CONFIG_SSH_SERVER=1 +#$CONFIG_GPG=1 diff --git a/install.sh b/install.sh index c5ddd88..1844b4a 100644 --- a/install.sh +++ b/install.sh @@ -6,22 +6,27 @@ source deploy.conf # Change apt sources to use https sed -i "s/http/https/" /etc/apt/sources.list +[ -n $BACKPORTS ] && echo "deb https://deb.debian.org/debian/ bullseye-backports main" >> \ + /etc/apt/sources.list + # Update packages apt update -y && apt upgrade -y -if [ -n "$DESKTOP" ] then; - # Temporarily add contrib and non-free repos - sed -i "s/main/main contrib non-free/" /etc/apt/sources.list - apt update -y - # Install required non-free packages - apt install amd64-microcode firmware-amd-graphics - # Remove non-free repos - sed -i "s/main contrib non-free/main/" /etc/apt/sources.list - apt update -y -fi +# Temporarily add contrib and non-free repos for necessary proprietary firmware and microcode +sed -i "s/main/main contrib non-free/" /etc/apt/sources.list +apt update -y + +[ -n $AMDCPU ] && apt install amd64-microcode -y +[ -n $AMDGPU ] && apt install firmware-amd-graphics -y +[ -n $INTELCPU ] && apt install intel-microcode -y -# Install packages - do not install recommendations -apt install "$(cat packages)" -y +# Remove contrib and non-free repos +sed -i "s/main contrib non-free/main/" /etc/apt/sources.list +apt update -y + +# Install packages +apt install "$(cat packages.base)" -y +apt install "$(cat packages.custom)" -y # basic configuration of ufw ufw default deny incoming @@ -38,8 +43,40 @@ su $user passwd -l root # Get and deploy dotfiles +echo "backing up current home directory to ~/home_backup" +rsync -av $HOME/ $HOME/home_backup/ cd $HOME git clone https://git.chudnick.com/dotfiles.git -cd dotfiles -mv * ../ +rsync --exclude .git/ --exclude LICENSE -av $HOME/dotfiles/ $HOME +chsh -s $(which zsh) $USER + +# DWM +if [ -n $DWM ] then; + mkdir -p $HOME/.local/src/ + cd $HOME/.local/src/ + sudo apt install libx11-dev libx11-xcb-dev libxcb-res0-dev libxft-dev libxinerama-dev -y + git clone https://git.chudnick.com/dwm + cd dwm + sudo make install + cd $HOME +fi + +# DWMBLOCKS +if [ -n $DWMBLOCKS ] then; + mkdir -p $HOME/.local/src/ + cd $HOME/.local/src/ + sudo apt install libx11-dev -y + git clone https://git.chudnick.com/dwmblocks + cd dwmblocks + sudo make install + cd $HOME +fi + +# SSH +[ -n $CONFIG_SSH ] && ssh-keygen + +# SSH SERVER +[ -n $CONFIG_SSH_SERVER ] && sudo apt install openssh-server -y && sudo ufw allow ssh +# GPG +[ -n $CONFIG_GPG ] && gpg --full-gen-key -- cgit v1.2.3