-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-arch-root
More file actions
executable file
·87 lines (72 loc) · 1.91 KB
/
setup-arch-root
File metadata and controls
executable file
·87 lines (72 loc) · 1.91 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
set -e
echo en_US.UTF-8 UTF-8 > /etc/locale.gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
echo LC_ALL=en_US.UTF-8 >> /etc/locale.conf
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen
echo "[options]" >> /etc/pacman.conf
echo Color >> /etc/pacman.conf
echo ILoveCandy >> /etc/pacman.conf
pacman-key --init
pacman-key --populate
echo 'Server = http://mirror.5i.fi/archlinux/$repo/os/$arch' \
> /etc/pacman.d/mirrorlist
pacman -Syyu --noconfirm
pacman -S --noconfirm \
base-devel \
util-linux \
openssh \
gum \
sudo \
shadow \
git \
curl \
go \
make \
redis \
socat \
nginx \
lolcat \
figlet \
emacs \
bash-completion \
dracut
dracut --force --no-hostonly --strip --no-kernel --omit "network lvm" \
/boot/initramfs-firecracker.img
systemctl enable systemd-networkd
systemctl enable systemd-resolved
systemctl enable sshd
systemctl enable nginx
# This block is verbatim, without variable interpolation.
cat >>/etc/bash.bashrc <<'EOF'
export PATH=$HOME/.local/bin:$PATH
PS1=$'\[\e[1m\]\h\[\e[0m\]:\w\[\e[1m\]`eval "$PS1GIT"`\[\e[0m\]\$ '
PS1GIT='[[ `git status --short 2>/dev/null` ]] && echo \*'
[[ $TERM = xterm* ]] && PS1='\[\033]2;\h:\w\007\]'"$PS1"
echo Node.Town | figlet -f standard | gum style --padding "1 2" | lolcat
EOF
# Set up sudoers for wheel group
mkdir -p /etc/sudoers.d
echo '%wheel ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/wheel
# Create .ssh directory for root user
mkdir -p /root/.ssh
chmod 700 /root/.ssh
# Create systemd service for broadway-proxy if available
if [ -f /usr/local/bin/broadway-proxy ]; then
cat > /etc/systemd/system/broadway-proxy.service <<EOF
[Unit]
Description=Broadway Proxy
After=network.target
[Service]
Type=simple
Environment="BROADWAY_URL=http://localhost:2000"
Environment="PORT=2001"
ExecStart=/usr/local/bin/broadway-proxy
Restart=always
[Install]
WantedBy=multi-user.target
EOF
systemctl enable broadway-proxy
fi