scripts/void-setup.sh

117 lines
2.3 KiB
Bash
Raw Normal View History

2024-08-03 10:53:26 +03:00
#!/bin/bash
# TODO: setup network using iwd
# TODO: setup PolicyKit
# TODO: setup lightdm
# TODO: setup compositor
# TODO: install nvidia drivers (if nvidia gpu installed)
2024-08-19 12:52:36 +03:00
install_doas=1
2024-08-19 15:24:15 +03:00
sync_dotfiles=1
2024-08-19 20:10:08 +03:00
install_gui=1
2024-08-19 20:14:24 +03:00
install_julia=1
2024-08-19 12:52:36 +03:00
usage() {
echo "Usage: $0 [OPTIONS]"
echo 'Options:'
echo ' -h, --help Display this message'
echo " --no-doas Don't install doas"
2024-08-19 15:24:15 +03:00
echo " --no-sync Don't Sync dotfiles"
2024-08-19 20:10:08 +03:00
echo " --no-gui Don't install GUI things"
2024-08-19 20:14:24 +03:00
echo " --no-julia Don't install Julia Programming Language"
2024-08-19 12:52:36 +03:00
}
while [ $# -gt 0 ]; do
case $1 in
-h | --help)
usage
exit 0
;;
--no-doas)
install_doas=0
;;
2024-08-19 15:24:15 +03:00
--no-sync)
sync_dotfiles=0
;;
2024-08-19 20:10:08 +03:00
--no-gui)
install_gui=0
;;
2024-08-19 20:14:24 +03:00
--no-julia)
install_julia=0
;;
2024-08-19 12:52:36 +03:00
*)
echo "Invalid argument: $1" >&2
usage
exit 1
;;
esac
shift
done
2024-08-19 19:52:35 +03:00
if command -v doas &> /dev/null; then
doas="doas"
else
doas="sudo"
fi
# system full-update
2024-08-19 19:52:35 +03:00
$doas xbps-install -Suy xbps
$doas xbps-install -Suy
2024-08-19 20:10:08 +03:00
# install some packages that i use
$doas xbps-install -y git patch wget curl vim juliaup yt-dlp tree
2024-08-03 10:53:26 +03:00
# setup doas
2024-08-19 19:56:12 +03:00
if [ install_doas == 1 ]; then
2024-08-19 19:52:35 +03:00
$doas xbps-install -y opendoas
$doas bash -c "echo 'permit nopass $USER as root' > /etc/doas.conf"
2024-08-19 12:52:36 +03:00
doas="doas"
fi
2024-08-03 10:53:26 +03:00
2024-08-07 11:28:44 +03:00
mkdir ./.setup-void.temp
cd ./.setup-void.temp
2024-08-03 10:53:26 +03:00
2024-08-19 19:56:12 +03:00
if [ sync_dotfiles == 1 ]; then
2024-08-19 15:24:15 +03:00
$doas xbps-install -y rsync
git clone https://github.com/spirit-x64/dotfiles.git
rsync -a --exclude='.git/' --exclude='LICENSE' --exclude='.gitignore' dotfiles/ $HOME
fi
2024-08-19 20:10:08 +03:00
if [ install_gui == 1 ]; then
$doas xbps-install -y make gcc libX11-devel libXft-devel libXinerama-devel xorg-server xinit xauth xorg-fonts xorg-input-drivers pkg-config
2024-08-03 10:53:26 +03:00
2024-08-19 20:10:08 +03:00
git clone https://github.com/spirit-x64/dwm.git
git clone https://github.com/spirit-x64/dmenu.git
git clone https://github.com/spirit-x64/st.git
2024-08-03 10:53:26 +03:00
2024-08-19 20:10:08 +03:00
cd dwm
$doas make clean install
2024-08-03 10:53:26 +03:00
2024-08-19 20:10:08 +03:00
cd ../dmenu
$doas make clean install
2024-08-03 10:53:26 +03:00
2024-08-19 20:10:08 +03:00
cd ../st
$doas make clean install
2024-08-03 10:53:26 +03:00
2024-08-19 20:10:08 +03:00
cd ..
2024-08-18 19:57:49 +03:00
2024-08-19 20:10:08 +03:00
echo 'exec dwm' > $HOME/.xinitrc
2024-08-03 10:53:26 +03:00
2024-08-19 20:10:08 +03:00
# packages i use that depends on gui
$doas xbps-install -y firefox vscode godot
fi
2024-08-03 10:53:26 +03:00
2024-08-19 20:14:24 +03:00
if [ install_julia == 1 ]; then
$doas xbps-install -y juliaup
$doas ln -s /usr/bin/julialauncher /usr/bin/julia
2024-08-03 10:53:26 +03:00
2024-08-19 20:14:24 +03:00
juliaup self update
juliaup add 1.0.0
juliaup add 1.10
juliaup add 1.11
juliaup default 1.10
fi
2024-08-07 11:28:44 +03:00
# clean up
rm -fr ./.setup-void.temp/