dev-scripts/scripts/debian10/install-dev-base.sh

80 lines
2.7 KiB
Bash
Raw Normal View History

#!/bin/sh
_home_dir="/home/$user"
# check we have ssh access
[ -z "$ssh_user" ] || [ -z "$ssh_root" ] && echo "Error: user and root ssh configuration must be specified" && exit 5
ssh -T $ssh_root << EOSSH
echo "Installing packages .."
export DEBIAN_FRONTEND=noninteractive
2020-09-04 21:24:19 +00:00
echo "Installing packages .."
apt-get -qq -y install curl gnupg2 ninja-build gettext libtool libtool-bin autoconf automake cmake g++ pkg-config unzip python-pip python3-pip fzf vim ctags
echo "Packages installed"
echo "Installing lazygit .."
curl -fsSL https://github.com/jesseduffield/lazygit/releases/download/v0.22.1/lazygit_0.22.1_Linux_x86_64.tar.gz --output /tmp/lazygit.tar.gz
tar xf /tmp/lazygit.tar.gz -C /usr/local/bin/
2020-09-04 21:08:53 +00:00
rm -v /tmp/lazygit.tar.gz
echo "Installing lf ..."
curl -fsSL https://github.com/gokcehan/lf/releases/download/r16/lf-linux-amd64.tar.gz --output /tmp/lf.tar.gz
tar xf /tmp/lf.tar.gz -C /usr/local/bin/
2020-09-04 21:08:53 +00:00
rm -v /tmp/lf.tar.gz
echo "Installing neovim ..."
git clone https://github.com/neovim/neovim /tmp/neovim
cd /tmp/neovim
2020-09-04 21:28:10 +00:00
make -s CMAKE_BUILD_TYPE=Release
make -s install
echo "Neovim installed"
2020-09-04 18:43:43 +00:00
if command -v php ; then
echo "Installing composer .."
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '8a6138e2a05a8c28539c9f0fb361159823655d7ad2deecb371b04a83966c61223adc522b0189079e3e9e277cd72b8897') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php --filename=composer --install-dir=/usr/local/bin
php -r "unlink('composer-setup.php');"
fi
2020-09-04 21:15:22 +00:00
EOSSH
ssh -T $ssh_root << EOSSH
2020-09-04 18:43:43 +00:00
su "$user"
echo "Installing nvm ..."
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
echo 'export NVM_DIR="\$HOME/.nvm"' >> "$_home_dir/.profile"
echo '[ -s "\$NVM_DIR/nvm.sh" ] && \. "\$NVM_DIR/nvm.sh"' >> "$_home_dir/.profile"
2020-09-04 21:15:22 +00:00
EOSSH
ssh -T $ssh_root << EOSSH
2020-09-04 21:15:22 +00:00
su --login "$user"
. ./.profile
nvm install --lts --latest-npm
2020-09-04 21:15:22 +00:00
EOSSH
ssh -T $ssh_user << EOSSH
. ./.profile
echo "Configuring neovim ..."
npm install -g neovim
python2 -m pip install --user --upgrade pynvim
python3 -m pip install --user --upgrade pynvim
python3 -m pip install --user --upgrade neovim-remote
2020-09-04 20:19:35 +00:00
git clone ssh://git@git.rayelliott.dev:3222/dots/nvim.git $_home_dir/.config/nvim
curl -fLo $_home_dir/.config/nvim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
nvim --headless +PlugInstall +qall
echo "Configuring lf .."
lf config
if [ -e "$_home_dir/.config/lf" ] ; then
2020-09-04 21:08:53 +00:00
mv -v "$_home_dir/.config/lf" "$_home_dir/.config/lf-original-$(date +%s)"
fi
2020-09-04 20:19:35 +00:00
git clone ssh://git@git.rayelliott.dev:3222/dots/lf.git "$_home_dir/.config/lf"
EOSSH