dev-containers/base-ubuntu/install-packages.sh

55 lines
1.8 KiB
Bash

#!/bin/bash
set -e
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
luarocks curl unzip ripgrep fd-find \
python3 build-essential man-db
# Install Tree-sitter and Neovim
ARCH=$(dpkg --print-architecture)
TREE_SITTER_VERSION="0.25.2"
NVIM_VERSION="0.10.4"
if [[ "$ARCH" == "arm64" ]]; then
TREE_SITTER_URL="https://github.com/tree-sitter/tree-sitter/releases/download/v${TREE_SITTER_VERSION}/tree-sitter-linux-arm64.gz"
NVIM_URL="https://github.com/neovim/neovim/releases/download/v${NVIM_VERSION}/nvim-linux-arm64.tar.gz"
elif [[ "$ARCH" == "amd64" ]]; then
TREE_SITTER_URL="https://github.com/tree-sitter/tree-sitter/releases/download/v${TREE_SITTER_VERSION}/tree-sitter-linux-x64.gz"
NVIM_URL="https://github.com/neovim/neovim/releases/download/v${NVIM_VERSION}/nvim-linux-x86_64.tar.gz"
else
echo "Unsupported architecture: $ARCH"
exit 1
fi
# Download and install Tree-sitter
echo "Installing Tree-sitter..."
wget -O /tmp/tree-sitter.gz "$TREE_SITTER_URL"
gzip -d /tmp/tree-sitter.gz
chmod +x /tmp/tree-sitter
sudo mv /tmp/tree-sitter /usr/local/bin/tree-sitter
# Download and install Neovim
echo "Installing Neovim..."
wget -O /tmp/nvim.tar.gz "$NVIM_URL"
sudo tar -xzf /tmp/nvim.tar.gz -C /opt
NVIM_DIR=$(find /opt -maxdepth 1 -type d -name "nvim-linux-*")
sudo ln -s "${NVIM_DIR}/bin/nvim" /usr/local/bin/nvim
rm /tmp/nvim.tar.gz
git clone https://gitea.tomastm.com/tomas.mirchev/dotfiles.git $HOME/.dotfiles
cd $HOME/.dotfiles
echo $(pwd)
echo $(ls -a)
python3 manage.py install linux-dev
python3 manage.py link linux-dev --copy --force
bash ./scripts/linux-setup_docker.sh
# Cleanup
rm -rf $HOME/.dotfiles
# sudo apt-get purge -y build-essential python3
sudo apt-get autoremove -y
sudo apt-get clean -y
sudo rm -rf /var/lib/apt/lists/*