-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-machine-arch
executable file
·62 lines (54 loc) · 1.23 KB
/
build-machine-arch
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
#!/bin/bash
# Arch / EndeavourOS
# curl -sSL https://raw.githubusercontent.com/hut8/build-machine/master/build-machine-arch | bash
set -euo pipefail
repo_url='https://raw.githubusercontent.com/hut8/build-machine/master'
if ! [ $(id -u) = 0 ]; then
echo 'this script must be run as root'
exit 1
fi
user_exists(){ id "$1" &>/dev/null; }
pacman -Syu --noconfirm --needed \
base-devel \
git \
emacs \
curl \
gnupg \
htop \
cmake \
jq \
nushell \
openbsd-netcat \
pv \
rsync \
python \
python-pip \
recode \
ripgrep \
tmux \
tree \
wget \
zsh \
s3fs-fuse \
sshfs \
go \
ttf-hack-nerd \
lsof
echo "installing yay"
git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si
# Create my user
if ! user_exists "liam";
then
echo 'creating user'
useradd \
--comment 'Liam' \
--user-group \
--shell /usr/bin/zsh \
--create-home \
liam
else
chsh --shell /usr/bin/zsh liam # idempotent
fi
curl -sSL "$repo_url/sudoers" > /etc/sudoers.d/liam
curl -sSL "$repo_url/build-account" |
sudo --set-home -u liam /usr/bin/zsh