-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboostrap.sh
212 lines (182 loc) · 6.32 KB
/
boostrap.sh
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
#!/bin/bash
############################################################
# Functions #
############################################################
Help()
{
# Display Help
echo "Bootstrapping script for various Linux systems."
echo "(may end with undesirable/insecure results)"
echo
echo "Syntax: ./boostrap.sh [-h|r|a|n]"
echo "options:"
echo "h Print this help screen."
echo "r Run ricing script."
echo "a Run Arch installer."
echo "n Run NixOS installer."
echo "c Cleans repo (useful after bootstrapping)."
echo
}
Ricing()
{
# bootstrapping GTK theme
mkdir ~/.themes/ && cp resources/Pop-nord-dark.zip ~/.themes/
unzip ~/.themes/Pop-nord-dark.zip
gsettings set org.gnome.shell.extensions.user-theme name "Pop-nord-dark"
gsettings set org.gnome.desktop.interface gtk-theme name "Pop-nord-dark"
# setting wallpaper
cp resources/wallpaper.png ~/.themes/
gsettings set org.gnome.desktop.background picture-uri ~/.themes/wallpaper.png
# gnome terminal theme
cd resources/
git clone https://github.com/arcticicestudio/nord-gnome-terminal.git
cd nord-tilix/
./install.sh
cd ..
}
Arch()
{
# system upgrade
sudo pacman -Syu
# installing essentials (lightweight only)
sudo pacman -S fish yay micro feh base-devel
# setting fish to default shell
sudo chsh -s /bin/fish
# installing rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# installing bonus programs
yay -S ibus-typing-booster lsp-plugins easyeffects syncthing libdbusmenu-glib \
xclip gthumb wike keeweb-desktop-bin vlc okteta monero-gui seahorse pinta gfeeds \
ghidra foliate spotify libgepub nerd-fonts-fira-code fd discord tootle meld \
obsidian-appimage spicetify-cli spotify gitg obs-studio spicetify-themes-git curlew \
qalculate-gtk polari tilix visual-studio-code-bin betterdiscordctl-git lutris \
libreoffice-fresh chromium blanket bottom auto-cpufreq ventoy hunspell-en_us github-cli \
curtail gimagereader-gtk tesseract-data-eng evolution transmission-gtk evince \
geeqie gwenview
# beep beep installing Taxi
yay -S python-dulwich
yay -S taxi-git
# install virtual machine stuffs
sudo pacman -Syu qemu libvirt virt-manager
# rice
yay -S nordic-theme papirus-folders-nordic ttf-ibm-plex inter-font
# battle.net dependencies
sudo pacman -S lib32-gnutls lib32-libldap lib32-libgpg-error lib32-sqlite \
lib32-libpulse lib32-alsa-plugins
# installing retroarch/libretro cores
yay -S retroarch retroarch-assets-ozone libretro-beetle-pce libretro-beetle-psx \
libretro-beetle-supergrafx libretro-blastem libretro-bsnes libretro-citra \
libretro-desmume libretro-dolphin libretro-gambatte libretro-mgba \
libretro-mupen64plus-next
# syncthing setup
systemctl enable syncthing@toast.service
systemctl start syncthing@toast.service
# git ident
git config --global user.email "smol@toast.cyou"
git config --global user.name "toast"
}
BootstrapNixOS()
{
su
# Initialize system config
echo "{ config, pkgs, ... }:
{
imports =
[ # Here we list the modules we want to add to our config:
./modules/gaming.nix
./modules/terminal.nix
];
system.stateVersion = "unstable";
}" >> /etc/nixos/configuration.nix
# Generate hardware profile and link repo to system config
nixos-generate-config
ln -s nix/nixos/modules/ /etc/nixos;
# Select system preset
echo "Select a preset profile to continue:";
echo " [d]esktop (Intel/Nvidia)";
echo " [l]aptop (Intel)";
read -p "\nOption " profile
case $profile in
d ) cp /etc/nixos/hardware-configuration.nix nix/nixos/modules/devices/desktop/;
sed '6i\
./modules/devices/desktop/desktop.nix
./modules/devices/laptop/hardware-configuration.nix
' /etc/nixos/configuration.nix;;
l ) cp /etc/nixos/hardware-configuration.nix nix/nixos/modules/devices/laptop/;
sed '6i\
./modules/devices/laptop/laptop.nix
./modules/devices/laptop/hardware-configuration.nix
' /etc/nixos/configuration.nix;;
* ) echo "invalid response";
exit 1;;
esac
# Pick desktop environment
echo "Select a desktop environment to continue:";
echo " [k]de plasma";
echo " [g]nome";
read -p "\nOption " desktop
case $desktop in
k )
sed '6i\
./modules/plasma.nix
' /etc/nixos/configuration.nix;;
g ) cp /etc/nixos/hardware-configuration.nix nix/nixos/modules/devices/laptop/;
sed '6i\
./modules/gnome.nix
' /etc/nixos/configuration.nix;;
* ) echo "invalid response";
exit 1;;
esac
# Configure system username
read -p "Enter your system username: " username
sed -i "s/users.users.*/users.users.=$username = {/g"
echo "";
echo "This config will be committed in 5 seconds...";
sleep 5
nixos-rebuild switch --upgrade-all
exit;
}
NixOS()
{
echo "The following script will lobotomize your NixOS install and potentially"
echo "leave your system in a non-secure state."
read -p "Do you want to proceed? (y/n) " yn
case $yn in
y ) BootstrapNixOS;;
n ) echo "exiting...";
exit;;
* ) echo "invalid response";
exit 1;;
esac
echo "The following script will lobotomize your NixOS install and potentially"
echo "leave your system in a non-secure state."
}
############################################################
############################################################
# Main program #
############################################################
############################################################
set -euo pipefail
############################################################
# Process the input options. Add options as needed. #
############################################################
# Get the options
while getopts ":hranc:" option; do
case $option in
h) # Prints help
Help
exit;;
r) # Installs Ricing
Help
exit;;
a) # Bootstraps Arch system
Name=$OPTARG;;
n) # Bootstraps NixOS system
Name=$OPTARG;;
c) # Cleans repo
git reset --hard HEAD;;
\?) # Invalid option
echo "Error: Invalid option"
exit;;
esac
done