diff options
author | Sam Chudnick <sam@chudnick.com> | 2021-11-27 08:55:14 -0500 |
---|---|---|
committer | Sam Chudnick <sam@chudnick.com> | 2021-11-27 08:55:14 -0500 |
commit | f3bc97f94d47de36cfa3c3317fa683a6c2277043 (patch) | |
tree | 315c710d24842bb028e92635b6a0052d83cae300 |
initial commit
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | deploy.conf | 7 | ||||
-rw-r--r-- | install.sh | 45 |
3 files changed, 53 insertions, 0 deletions
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 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Configuration file for deployment script | ||
4 | |||
5 | #$DESKTOP=1 | ||
6 | #$APTOPTS="--no-install-recommends" | ||
7 | |||
diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..c5ddd88 --- /dev/null +++ b/install.sh | |||
@@ -0,0 +1,45 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # source configuration file | ||
4 | source deploy.conf | ||
5 | |||
6 | # Change apt sources to use https | ||
7 | sed -i "s/http/https/" /etc/apt/sources.list | ||
8 | |||
9 | # Update packages | ||
10 | apt update -y && apt upgrade -y | ||
11 | |||
12 | if [ -n "$DESKTOP" ] then; | ||
13 | # Temporarily add contrib and non-free repos | ||
14 | sed -i "s/main/main contrib non-free/" /etc/apt/sources.list | ||
15 | apt update -y | ||
16 | # Install required non-free packages | ||
17 | apt install amd64-microcode firmware-amd-graphics | ||
18 | # Remove non-free repos | ||
19 | sed -i "s/main contrib non-free/main/" /etc/apt/sources.list | ||
20 | apt update -y | ||
21 | fi | ||
22 | |||
23 | # Install packages - do not install recommendations | ||
24 | apt install "$(cat packages)" -y | ||
25 | |||
26 | # basic configuration of ufw | ||
27 | ufw default deny incoming | ||
28 | ufw default allow outgoing | ||
29 | ufw default routed disabled | ||
30 | ufw reload | ||
31 | |||
32 | # add user to sudo group | ||
33 | user=$(cat /etc/passwd | grep 1000 | cut -d ':' -f 1) | ||
34 | usermod -aG sudo $user | ||
35 | |||
36 | # Switch to standard user and disable root password | ||
37 | su $user | ||
38 | passwd -l root | ||
39 | |||
40 | # Get and deploy dotfiles | ||
41 | cd $HOME | ||
42 | git clone https://git.chudnick.com/dotfiles.git | ||
43 | cd dotfiles | ||
44 | mv * ../ | ||
45 | |||