2024-02-29 03:45:58 +00:00
#!/bin/sh
# void setup script - developed by acidvegas (https://git.acid.vegas/void)
# note: After importing keys: printf "FINGERPRINTHERE:6:" | gpg --import-ownertrust
set -xev
# Configuration
2024-07-16 22:12:48 +00:00
ARCH=x86_64 # x86_64 or x86_64-musl
CPU=intel # amd or intel (blank for none)
2024-02-29 03:45:58 +00:00
DISPLAY_SERVER=xorg # xorg or blank for none
2024-07-16 22:12:48 +00:00
GFX_DRIVER=intel # amd, intel, or nvidia (blank for none)
2024-10-22 03:34:13 +00:00
PI=0 # 0 for desktop, 1 for Raspberry Pi
2024-07-17 00:20:21 +00:00
REMOTE=dropbear # dropbear or ssh (blank for none)
2024-07-16 22:12:48 +00:00
USERNAME=acidvegas
2024-07-17 00:20:21 +00:00
WIFI_DEV=wlan0
2024-02-29 03:45:58 +00:00
2024-10-22 03:34:13 +00:00
2024-02-29 03:45:58 +00:00
GIT_URL="https://raw.githubusercontent.com/acidvegas/void/master"
setup_root() {
2024-07-10 00:50:57 +00:00
setup_packages
2024-07-16 22:12:48 +00:00
useradd -m -s /bin/bash $USERNAME && gpasswd -a $USERNAME wheel && passwd $USERNAME
gpasswd -a $USERNAME _incus && gpasswd -a $USERNAME _incus-admin # Typically incus & incus-admin but void uses the underscore prefix
2024-02-29 03:45:58 +00:00
2024-07-14 04:54:37 +00:00
for item in 6x11 7x12 7x14; do
wget -O /usr/share/kbd/consolefonts/ohsnap${item}r.psfu $GIT_URL/font/ohsnap${item}r.psfu
done
2024-02-29 03:45:58 +00:00
printf "\nnohook resolv.conf\n" >> /etc/dhcpcd.conf
2024-07-14 04:54:37 +00:00
#printf "\nipv4only\nnodhcp6\n" >> /etc/dhcpcd.conf # For fixing "dhcpcd: ipv6nd_sendadvertisement: Operation not permitted" error
2024-10-21 18:46:35 +00:00
echo "CGROUP_MODE=\"unified\"" >> /etc/rc.conf
2024-07-14 04:54:37 +00:00
printf "nameserver 9.9.9.9\nnameserver149.112.112.112\nnameserver 2620:fe::fe\nnameserver 2620:fe::9" > /etc/resolv.conf
2024-02-29 03:45:58 +00:00
echo "proc /proc proc defaults,hidepid=2 0 0" >> /etc/fstab && mount -o remount /proc
printf "set boldtext\nset minibar\nset nohelp\nset nowrap\nset quickblank\nset tabsize 4\nunbind ^J main\nset selectedcolor black,red\ninclude \"/usr/share/nano/*.nanorc\"\n" > /etc/nanorc
printf "\nexport HISTFILE=/dev/null\nexport LESSHISTFILE=/dev/null\nexport PYTHONHISTFILE=/dev/null\n" >> /etc/profile
2024-07-15 03:09:01 +00:00
printf "#\!/bin/sh\nclear && (echo && printf \" E N T E R T H E V O I D\n" && echo) | nms -af red\n" > /etc/profile.d/motd.sh
2024-02-29 03:45:58 +00:00
printf "\nFONT=\"ohsnap6x11r\"\n" >> /etc/rc.conf
printf "Defaults lecture = always\nDefaults lecture_file = /etc/sudoers.d/sudoers.lecture\nroot ALL=(ALL) ALL\n%%wheel ALL=(ALL) ALL\n" > /etc/sudoers
printf "\n\033[1m \033[32m\"Bee\" careful \033[34m__\n \033[32mwith sudo! \033[34m// \ \n \\\\\\_/ \033[33m//\n \033[35m''-.._.-''-.._.. \033[33m-(||)(')\n '''\033[0m\n" > /etc/sudoers.d/sudoers.lecture
2024-10-22 03:34:13 +00:00
printf "\nhsts=0\n" >> /etc/wgetrc
2024-07-16 23:08:30 +00:00
2024-10-21 18:46:35 +00:00
# For Drevo Calibur V2 FN key fix
#echo 0 | sudo pkexec tee /sys/module/hid_apple/parameters/fnmode
2024-07-17 00:20:21 +00:00
if [ $REMOTE = "dropbear" ]; then
LOCAL_IP=$(ip addr show $WIFI_DEV | grep 'inet ' | awk '{print $2}' | cut -d'/' -f1)
RND_PORT=$(shuf -i 10000-65535 -n 1)
xbps-install -y dropbear
printf '#!/bin/sh\nexec 2>&1\n[ -r conf ] && . ./conf\nexec dropbear -p $LOCAL_IP:$RND_PORT -w -s -R -F' > /etc/sv/dropbear/run
2024-07-16 23:08:30 +00:00
fi
2024-10-21 18:46:35 +00:00
2024-07-17 00:20:21 +00:00
for item in dhcpcd incus incus-user socklog-unix nanoklogd wpa_supplicant; do
2024-07-14 04:54:37 +00:00
ln -sfv /etc/sv/$item /var/service # Use /etc/runit/runsvdir/default/ instead of /var/service if in a chroot environemnt
done
2024-02-29 03:45:58 +00:00
}
2024-07-14 04:54:37 +00:00
setup_nonfree() {
2024-02-29 03:45:58 +00:00
xbps-install -Suy void-repo-nonfree
if [ $CPU = "intel" ]; then
2024-07-14 04:54:37 +00:00
xbps-install -y intel-ucode linux-firmware-intel
2024-02-29 03:45:58 +00:00
elif [ $CPU = "amd" ]; then
xbps-install -y linux-firmware-amd
fi
if [ $DISPLAY_SERVER = "xorg" ]; then
if [ $GFX_DRIVER = "intel" ]; then
2024-07-14 04:54:37 +00:00
xbps-install -y mesa-dri vulkan-loader mesa-vulkan-intel intel-video-accel
elif [ $GFX_DRIVER = "amd" ]; then
xbps-install -y mesa-dri vulkan-loader mesa-vulkan-radeon radeon-video-accel # Un-tested
elif [ $GFX_DRIVER = "nvidia" ]; then
xbps-install -y nvidia nvidia-libs nvidia-settings nvidia-xconfig # Un-tested
2024-02-29 03:45:58 +00:00
fi
2024-07-14 04:54:37 +00:00
fi
2024-10-22 03:34:13 +00:00
xbps-reconfigure -f linux
xbps-install -y Signal-Desktop
2024-07-14 04:54:37 +00:00
}
setup_packages() {
# Un-comment to enable non-free proprietary software to be installed
2024-10-22 03:34:13 +00:00
setup_nonfree
2024-07-14 04:54:37 +00:00
if [ $DISPLAY_SERVER = "xorg" ]; then
2024-07-16 21:39:19 +00:00
#xbps-install -y mesa-dri # Raspberry Pi
2024-07-14 04:54:37 +00:00
xbps-install -y xorg libX11 libX11-devel libXft libXft-devel libXinerama libXinerama-devel libXrandr libXrandr-devel xbacklight xrandr
xbps-install -y alacritty dmenu dunst firefox pinentry-dmenu redshift scrot unclutter xclip
2024-07-16 23:08:30 +00:00
xbps-install -y ohsnap-font font-unifont-bdf freefont-ttf noto-fonts-ttf noto-fonts-ttf-extra noto-fonts-cjk noto-fonts-emoji # These fonts give you the most unicode support coverage (noto)
2024-02-29 03:45:58 +00:00
fi
# Development
2024-07-16 21:39:19 +00:00
if [ $ARCH = 'x86_64' ]; then
2024-07-14 04:54:37 +00:00
xbps-install -y gcc
fi
2024-10-22 03:34:13 +00:00
xbps-install -y cargo checkbashisms go make patch pkg-config python3 python3-pip
xbps-install -y ansible aws-cli python3-aiodns python3-aiofiles python3-aiohttp python3-boto3 python3-Flask terraform
2024-10-23 00:17:20 +00:00
xbps-install -y bluetuith
2024-02-29 03:45:58 +00:00
# Essentials
2024-07-17 00:20:21 +00:00
if [ $REMOTE = "dropbear" ]; then
xbps-install -y dhcpcd dropbear
elif [ $REMOTE = "ssh" ] || [ $REMOTE = "openssh" ]; then
xbps-install -y dhcpcd openssh
fi
2024-10-22 03:34:13 +00:00
xbps-install -y curl dropbear git jq progress rsync socklog-void tmux tor tree unzip whois zip
xbps-install -y tailscale wireguard wireguard-tools wireproxy
xbps-install -y python3-zulip zulip-desktop zulip-term
2024-07-15 03:05:40 +00:00
2024-07-16 21:39:19 +00:00
# Raspberry Pi specific
2024-10-21 18:46:35 +00:00
#xbps-install -y rng-tools && ln -sfv /etc/sv/rngd /var/service/ && sv up rngd
2024-07-16 21:39:19 +00:00
2024-10-22 03:34:13 +00:00
xbps-install -y glow gotify-cli gnupg2-scdaemon lxc incus incus-client incus-tools lazygit oath-toolkit websocat
2024-07-10 00:50:57 +00:00
#xbps-install -y earlyoom && ln -sfv /etc/sv/earlyoom /var/service/
2024-02-29 03:45:58 +00:00
# Alternatives
2024-10-22 03:34:13 +00:00
xbps-install -y bat btop delta duf exa procs xsv
2024-02-29 03:45:58 +00:00
2024-07-14 04:54:37 +00:00
# Fun
2024-10-22 03:34:13 +00:00
xbps-install -y asciiquarium chess-tui cmatrix no-more-secrets tuimoji tty-solitaire
2024-07-14 04:54:37 +00:00
# Audio
2024-10-22 03:34:13 +00:00
#xbps-install -y alsa-utils cmus ffmpeg id3v2 eyeD3 spotify-tui youtube-dl # Revamp audio setup at some point
# Hardware
xbps-install -y bluetuith gpsd
2024-07-14 04:54:37 +00:00
2024-02-29 03:45:58 +00:00
# Recon
2024-10-22 03:34:13 +00:00
xbps-install -y aircrack-ng bettercap bandwhich bpfmon ettercap kismet masscan tcpdump termshark wireshark
2024-07-14 04:54:37 +00:00
# Radio
#xbps-install -y airspy chirp CubicSDR gnuradio gqrx inspectrum librtlsdr rtl-sdr rx_tools SoapyRTLSDR SDRPlusPlus
2024-02-29 03:45:58 +00:00
}
setup_configs() {
2024-10-23 00:17:20 +00:00
mkdir -p $HOME/.config/alacritty/ && wget -O $HOME/.config/alacritty/alacritty.toml $GIT_URL/config/alacritty/alacritty.toml
mkdir -p $HOME/.config/cmus && wget -O $HOME/.config/cmus/autosave $GIT_URL/cmus/autosave
2024-07-15 03:38:47 +00:00
mkdir -p $HOME/.config/dunst && wget -O $HOME/.config/dunst/dunstrc $GIT_URL/dunst/dunstrc
2024-10-23 00:17:20 +00:00
mkdir -p $HOME/.config/git && wget -O $HOME/.config/git/gitconfig $GIT_URL/config/git/gitconfig
mkdir -p $HOME/.config/tmux && wget -O $HOME/.config/tmux/tmux.conf $GIT_URL/config/tmux/tmux.conf
mkdir -p $HOME/.config/X11/ && wget -O $HOME/.config/X11/xinitrc $GIT_URL/config/X11/xinitrc
2024-02-29 03:45:58 +00:00
2024-10-23 00:17:20 +00:00
mkdir -p $HOME/.local/share/bash
for item in bash_aliases bash_functions bash_fun bash_recon; do
wget -O $HOME/.local/share/bash/$item $GIT_URL/local/share/bash/$item
done
wget -O $HOME/.bashrc $GIT_URL/.bashrc
2024-02-29 03:45:58 +00:00
2024-10-23 00:17:20 +00:00
mkdir -p $HOME/.local/share/gnupg && wget -O $HOME/.local/share/gnupg/gpg.conf $GIT_URL/local/share/gnupg/gpg.conf
printf "pinentry-program /usr/bin/pinentry-curses\ndefault-cache-ttl 3600" > $HOME/.local/share/gnupg/gpg-agent.conf
chmod 700 $HOME/.local/share/gnupg && chmod 600 $HOME/.local/share/gnupg/*
2024-02-29 03:45:58 +00:00
2024-10-23 00:17:20 +00:00
mkdir -p $HOME/.local/bin/scripts
for SCRIPT in cmus-now gitremote irc-post-commit-hook mutag pmf shotz statusbar todo; do
wget -O $HOME/.local/bin/scripts/$SCRIPT $GIT_URL/scripts/$SCRIPT && chmod +x $HOME/.scripts/$SCRIPT
2024-02-29 03:45:58 +00:00
done
2024-07-17 00:27:41 +00:00
wget -O $HOME/.scripts/dbc https://raw.githubusercontent.com/acidvegas/dbc/main/dbc && chmod +x $HOME/.scripts/dbc
2024-02-29 03:45:58 +00:00
2024-07-15 03:18:03 +00:00
mkdir -p $HOME/.local/share/fonts && wget -O $HOME/.local/share/fonts/BlockZone.ttf $GIT_URL/font/BlockZone.ttf && fc-cache -f -v
2024-10-21 18:46:35 +00:00
VERSION=$(curl -s https://api.github.com/repos/obsidianmd/obsidian-releases/releases/latest | jq -r .tag_name | cut -c2-)
wget -O $HOME/.local/bin/obsidian https://github.com/obsidianmd/obsidian-releases/releases/download/v${VERSION}/Obsidian-${VERSION}.AppImage
2024-02-29 03:45:58 +00:00
}
setup_fun() {
BUILD=$HOME/dev/build
mkdir -p $BUILD
2024-07-16 23:48:23 +00:00
wget -O $HOME/.scripts/irc2ansi.py https://raw.githubusercontent.com/internet-relay-chat/archive/master/art/irc2ansi.py
2024-02-29 03:45:58 +00:00
wget -O $HOME/.scripts/bomber $GIT_URL/scripts/bomber && chmod +x $HOME/.scripts/bomber
wget -O $HOME/.scripts/pipes https://raw.githubusercontent.com/pipeseroni/pipes.sh/master/pipes.sh && chmod +x $HOME/.scripts/pipes
git clone https://github.com/AngelJumbo/lavat.git $BUILD/lavat
sudo make -C $BUILD/lavat clean install
git clone https://github.com/lptstr/fire --recurse $BUILD/fire
sudo make -C $BUILD/fire clean install
git clone https://github.com/ricoriedel/wipe $BUILD/wipe
cargo build --release --manifest-path $BUILD/wipe/Cargo.toml # Need to install
git clone https://github.com/pythops/bouncinamation $BUILD/bouncinamation
cargo build --release --manifest-path $BUILD/bouncinamation/Cargo.toml # Need to install
2024-07-10 00:50:57 +00:00
go install github.com/maaslalani/confetty@latest # Animations
go install github.com/maxpaulus43/go-sweep@latest # Minesweeper
2024-02-29 03:45:58 +00:00
}
setup_builds() {
BUILD=$HOME/dev/build
mkdir -p $BUILD
git clone --depth 1 http://git.suckless.org/dwm $BUILD/dwm
wget -O $BUILD/dwm/config.h $GIT_URL/dwm/config.h
wget -O $BUILD/dwm/patch_nosquares.diff $GIT_URL/dwm/patch_nosquares.diff
wget -O $BUILD/dwm/patch_notitles.diff $GIT_URL/dwm/patch_notitles.diff
patch $BUILD/dwm/drw.c $BUILD/dwm/patch_nosquares.diff
patch $BUILD/dwm/dwm.c $BUILD/dwm/patch_notitles.diff
sudo make -C $BUILD/dwm clean install
}
2024-10-22 03:34:13 +00:00
setup_user_packages() {
wget -O $HOME/.local/bin/cursor https://downloader.cursor.sh/linux/appImage/x64
chmod u+x $HOME/.local/bin/cursor
VERSION=$(curl -s https://api.github.com/repos/obsidianmd/obsidian-releases/releases/latest | jq -r .tag_name | cut -c2-)
wget -O $HOME/.local/bin/obsidian https://github.com/obsidianmd/obsidian-releases/releases/download/v${VERSION}/Obsidian-${VERSION}.AppImage
chmod u+x $HOME/.local/bin/obsidian
VERSION=$(curl -s https://api.github.com/repos/boxdot/gurk-rs/releases/latest | jq -r .tag_name)
wget -O $HOME/.local/bin/gurk https://github.com/boxdot/gurk-rs/releases/download/${VERSION}/gurk-x86_64-unknown-linux-gnu.tar.gz
chmod u+x $HOME/.local/bin/gurk
TEMP=$(mktemp -d)
wget -O $TEMP/zed.tar.gz https://zed.dev/api/releases/stable/latest/zed-linux-x86_64.tar.gz
tar -xzf $TEMP/zed.tar.gz -C $TEMP
mv $TEMP/zed.app/bin/zed $HOME/.local/bin/zed
rm -rf $TEMP
mkdir -p $HOME/.config/pip && printf "[global]\nbreak-system-packages = true" > $HOME/.config/pip/pip.conf
pip install --user asyncwhois ecs elasticsearch meshtastic scalene
cargo install binsider
cargo install git-dumper
cargo install netscanner
go install -v github.com/nxtrace/NTrace-core@latest
go install -v github.com/projectdiscovery/asnmap/cmd/asnmap@latest
go install -v github.com/projectdiscovery/chaos-client/cmd/chaos@latest
go install -v github.com/projectdiscovery/cvemap/cmd/cvemap@latest
go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latest
go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest
go install -v github.com/projectdiscovery/katana/cmd/katana@latest
go install -v github.com/projectdiscovery/mapcidr/cmd/mapcidr@latest
go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
go install -v github.com/projectdiscovery/tlsx/cmd/tlsx@latest
git clone https://github.com/projectdiscovery/nuclei-templates.git $HOME/dev/git/mirror/nuclei-templates
git clone https://github.com/blechschmidt/massdns.git $HOME/dev/git/mirror/massdns
make -C $HOME/dev/git/mirror/massdns && sudo make -C $HOME/dev/git/mirror/massdns install
}
2024-02-29 03:45:58 +00:00
2024-07-15 03:05:40 +00:00
[ "$#" -ne 1 ] && echo "usage: $0 [root|config|build|fun]" && exit 1
2024-02-29 03:45:58 +00:00
case "$1" in
2024-07-15 03:05:40 +00:00
root) setup_root ;;
config) setup_configs ;;
build) setup_builds ;;
fun) setup_fun ;;
*) echo "usage: $0 [root|config|build|fun]\n"; exit 1 ;;
2024-02-29 03:45:58 +00:00
esac