From f3bc97f94d47de36cfa3c3317fa683a6c2277043 Mon Sep 17 00:00:00 2001 From: Sam Chudnick Date: Sat, 27 Nov 2021 08:55:14 -0500 Subject: initial commit --- .gitignore | 1 + deploy.conf | 7 +++++++ install.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 .gitignore create mode 100644 deploy.conf create mode 100644 install.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f9ced93 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +packages diff --git a/deploy.conf b/deploy.conf new file mode 100644 index 0000000..64c97ae --- /dev/null +++ b/deploy.conf @@ -0,0 +1,7 @@ +#!/bin/sh +# +# Configuration file for deployment script + +#$DESKTOP=1 +#$APTOPTS="--no-install-recommends" + diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..c5ddd88 --- /dev/null +++ b/install.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +# source configuration file +source deploy.conf + +# Change apt sources to use https +sed -i "s/http/https/" /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 + +# Install packages - do not install recommendations +apt install "$(cat packages)" -y + +# basic configuration of ufw +ufw default deny incoming +ufw default allow outgoing +ufw default routed disabled +ufw reload + +# add user to sudo group +user=$(cat /etc/passwd | grep 1000 | cut -d ':' -f 1) +usermod -aG sudo $user + +# Switch to standard user and disable root password +su $user +passwd -l root + +# Get and deploy dotfiles +cd $HOME +git clone https://git.chudnick.com/dotfiles.git +cd dotfiles +mv * ../ + -- cgit v1.2.3