mirror of
https://github.com/guilhermewerner/dotfiles
synced 2025-06-15 10:54:18 +00:00
Update scripts
This commit is contained in:
145
bootstrap.sh
Normal file
145
bootstrap.sh
Normal file
@ -0,0 +1,145 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
detect_distro() {
|
||||
if [[ -f /etc/os-release ]]; then
|
||||
. /etc/os-release
|
||||
if [[ "$ID" == "ubuntu" ]]; then
|
||||
echo "Ubuntu"
|
||||
elif [[ "$ID" == "arch" ]]; then
|
||||
echo "Arch"
|
||||
else
|
||||
echo "Unknown"
|
||||
fi
|
||||
else
|
||||
echo "Unknown"
|
||||
fi
|
||||
}
|
||||
|
||||
is_wsl() {
|
||||
if grep -qi "Microsoft" /proc/version; then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
install_shared() {
|
||||
echo "Installing shared packages..."
|
||||
|
||||
sudo groupadd wireshark
|
||||
sudo usermod -aG wireshark $USER
|
||||
newgrp wireshark
|
||||
|
||||
cp ./shared/* ~
|
||||
cp ./linux/* ~
|
||||
|
||||
git clone https://github.com/asdf-vm/asdf ~/.asdf
|
||||
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
|
||||
chsh -s $(which zsh)
|
||||
curl -sS https://starship.rs/install.sh | sh
|
||||
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||
source "$HOME/.cargo/env"
|
||||
rustup toolchain install nightly
|
||||
rustup +nightly component add rust-src
|
||||
|
||||
asdf plugin add dotnet https://github.com/hensou/asdf-dotnet
|
||||
asdf plugin add golang https://github.com/kennyp/asdf-golang
|
||||
asdf plugin add java https://github.com/halcyon/asdf-java
|
||||
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejsn
|
||||
|
||||
asdf install dotnet 8.0.403
|
||||
asdf install golang 1.23.2
|
||||
asdf install java temurin-21.0.5+11.0.LTS
|
||||
asdf install nodejs 20.18.0
|
||||
|
||||
asdf global dotnet 8.0.403
|
||||
asdf global golang 1.23.2
|
||||
asdf global java temurin-21.0.5+11.0.LTS
|
||||
asdf global nodejs 20.18.0
|
||||
}
|
||||
|
||||
install_ubuntu() {
|
||||
echo "Installing Ubuntu packages..."
|
||||
|
||||
touch ~/.hushlogin
|
||||
|
||||
sudo apt update -y && sudo apt upgrade -y
|
||||
sudo add-apt-repository ppa:zhangsongcui3371/fastfetch
|
||||
|
||||
sudo apt install -y --no-install-recommends \
|
||||
autoconf \
|
||||
automake \
|
||||
bash \
|
||||
ca-certificates \
|
||||
clang \
|
||||
cmake \
|
||||
curl \
|
||||
dnsutils \
|
||||
fastfetch \
|
||||
ffmpeg \
|
||||
file \
|
||||
g++ \
|
||||
gcc \
|
||||
gh \
|
||||
git \
|
||||
gnupg \
|
||||
gzip \
|
||||
htop \
|
||||
iputils-ping \
|
||||
libc6-dev \
|
||||
libluajit-5.1-dev \
|
||||
libncurses5-dev \
|
||||
libssl-dev \
|
||||
libudev-dev \
|
||||
llvm \
|
||||
lsb-release \
|
||||
make \
|
||||
nano \
|
||||
ninja-build \
|
||||
python3 \
|
||||
python3-pip \
|
||||
samba \
|
||||
tar \
|
||||
tshark \
|
||||
unzip \
|
||||
wget \
|
||||
whois \
|
||||
xz-utils \
|
||||
yt-dlp \
|
||||
zsh
|
||||
|
||||
if grep -vq "microsoft" /proc/version; then
|
||||
sudo mkdir -p /etc/apt/keyrings
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||
echo \
|
||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
|
||||
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
sudo apt update
|
||||
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
|
||||
sudo usermod -aG docker $USER
|
||||
newgrp docker
|
||||
docker version
|
||||
fi
|
||||
}
|
||||
|
||||
install_arch() {
|
||||
echo "Installing Arch packages..."
|
||||
}
|
||||
|
||||
main() {
|
||||
distro=$(detect_distro)
|
||||
|
||||
if [[ "$distro" == "Ubuntu" ]]; then
|
||||
install_ubuntu
|
||||
install_shared
|
||||
elif [[ "$distro" == "Arch" ]]; then
|
||||
install_arch
|
||||
install_shared
|
||||
else
|
||||
echo "Unsupported distro."
|
||||
fi
|
||||
}
|
||||
|
||||
main
|
Reference in New Issue
Block a user