scripts/setup-void.sh
2024-08-19 20:10:08 +03:00
Ask

109 lines
2.1 KiB
Bash
Executable File

{bfbc892205dc213d50fc194018ac48f1c9482d30 true 2131 setup-void.sh 0xc001e3f490}

#!/bin/bash
# TODO: setup network using iwd
# TODO: setup PolicyKit
# TODO: setup lightdm
# TODO: setup compositor
# TODO: install nvidia drivers (if nvidia gpu installed)
install_doas=1
sync_dotfiles=1
install_gui=1
usage() {
echo "Usage: $0 [OPTIONS]"
echo 'Options:'
echo ' -h, --help Display this message'
echo " --no-doas Don't install doas"
echo " --no-sync Don't Sync dotfiles"
echo " --no-gui Don't install GUI things"
}
while [ $# -gt 0 ]; do
case $1 in
-h | --help)
usage
exit 0
;;
--no-doas)
install_doas=0
;;
--no-sync)
sync_dotfiles=0
;;
--no-gui)
install_gui=0
;;
*)
echo "Invalid argument: $1" >&2
usage
exit 1
;;
esac
shift
done
if command -v doas &> /dev/null; then
doas="doas"
else
doas="sudo"
fi
# system full-update
$doas xbps-install -Suy xbps
$doas xbps-install -Suy
# install some packages that i use
$doas xbps-install -y git patch wget curl vim juliaup yt-dlp tree
# setup doas
if [ install_doas == 1 ]; then
$doas xbps-install -y opendoas
$doas bash -c "echo 'permit nopass $USER as root' > /etc/doas.conf"
doas="doas"
fi
mkdir ./.setup-void.temp
cd ./.setup-void.temp
if [ sync_dotfiles == 1 ]; then
$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
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
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
cd dwm
$doas make clean install
cd ../dmenu
$doas make clean install
cd ../st
$doas make clean install
cd ..
echo 'exec dwm' > $HOME/.xinitrc
# packages i use that depends on gui
$doas xbps-install -y firefox vscode godot
fi
$doas ln -s /usr/bin/julialauncher /usr/bin/julia
juliaup self update
juliaup add 1.0.0
juliaup add 1.10
juliaup add 1.11
juliaup default 1.10
# clean up
rm -fr ./.setup-void.temp/