-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·122 lines (104 loc) · 3.62 KB
/
install
File metadata and controls
executable file
·122 lines (104 loc) · 3.62 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/bin/ash
rootify() {
if [ "$(id -u)" -eq 0 ]; then
"$@"
elif command -v doas >/dev/null 2>&1; then
doas "$@"
elif command -v sudo >/dev/null 2>&1; then
sudo "$@"
else
echo "Neither doas nor sudo is available, what have you done?" >&2
return 1
fi
}
printf "Please enter your username: "
read USER
while ! grep -q "^${USER}:" /etc/passwd; do
printf "Invalid user. Please create it first or enter another one: "
read USER
done
echo "Installing core packages for system setup..."
rootify apk update && apk upgrade
rootify apk add linux-firmware mesa-dri-gallium doas iwd openresolv seatd greetd greetd-tuigreet xwayland sway swaybg waybar grimshot clipman pipewire pipewire-pulse wireplumber || { echo "Installation failed! Exiting."; exit 1; }
rootify apk add flatpak bubblewrap font-jetbrains-mono-nerd htop pulsemixer foot impala cargo syncthing || echo "Failed to install extra tools!"
# Pinned commit hash for security
rootify -u $USER curl https://raw.githubusercontent.com/cargo-bins/cargo-binstall/c85f0eeb20318afaf27164c73f5411082b5b8675/install-from-binstall-release.sh | ash
export PATH=$PATH:~/.cargo/bin/
printf "Do you need a code editor? (y/n): "
read neovim
if [ "$neovim" = "y" ]; then
rootify apk add helix neovim build-base
fi
printf "Do you want echo cancelling? (y/n): "
read cancelling
if [ "$cancelling" = "y" ]; then
rootify apk add pipewire-echo-cancel
fi
printf "Do you want hibernation/sleep support? (y/n): "
read sleep
if [ "$sleep" = "y" ]; then
rootify apk add elogind
rootify rc-update add elognid default
fi
printf "Do you want bluetooth? (y/n): "
read bluetooth
if [ "$bluetooth" = "y" ]; then
echo "Setting up bluetooth related daemons..."
rootify rfkill unblock bluetooth 2> /dev/null
rootify apk add bluez bluez-openrc pipewire-spa-bluez wireplumber-bluez playerctl || { echo "Failed to install Bluetooth tools!"; exit 1; }
rootify rc-update add bluetooth
cargo binstall bluetui || echo "Failed to install bluetui!"
fi
printf "Do you want to enable screen sharing? (y/n): "
read portals
if [ "$portals" = "y" ]; then
rootify apk add xdg-desktop-portal xdg-desktop-portal-wlr || { echo "Failed to install desktop portals!"; exit 1; }
fi
printf "Do you want to enable automatic (backround) updates? (y/n): "
read update
if [ "$update" = "y" ]; then
echo "Writing auto update cronjob"
cat <<EOF rootify tee /etc/periodic/hourly/update > /dev/null
#!/bin/ash
apk update && apk upgrade
flatpak update -y
EOF
rootify chmod +x /etc/periodic/hourly/update
fi
echo "Setting up user..."
rootify cp .profile /home/$USER/.profile # Make sure we're not creating a file named $USER
rootify addgroup $USER wheel
echo "Cleaning up old configs"
rootify rm /etc/init.d/wpa_* 2> /dev/null
rootify rm /etc/network/interfaces 2> /dev/null
rootify rm /etc/greetd/config.toml 2> /dev/null
echo "Setting up network interfaces"
cat <<EOF | rootify tee /etc/network/interfaces > /dev/null
auto lo
allow-hotplug eth0
allow-hotplug usb0
iface lo inet loopback
iface eth0 inet dhcp
iface usb0 inet dhcp
EOF
echo "Configuring wireless settings..."
rootify rm /etc/iwd/main.conf 2> /dev/null
cat <<EOF | rootify tee /etc/iwd/main.conf > /dev/null
[General]
EnableNetworkConfiguration=True
[Network]
NameResolvingService=resolvconf
EOF
rootify rc-update add iwd boot
echo "Setting up the greeter"
rootify cp sway /usr/bin/sway-run
rootify mkdir -p /etc/greetd 2> /dev/null
cat <<EOF | rootify tee /etc/greetd/config.toml > /dev/null
[terminal]
vt = 7
[default_session]
command = "tuigreet --cmd sway-run --time"
user = "$USER"
EOF
rc-update add greetd default
echo "Installation complete. You now have a desktop! :yeppie:"