#!/bin/sh _home_dir="/home/$user" ssh -T $ssh << EOSSH echo "Installing packages .." export DEBIAN_FRONTEND=noninteractive apt-get -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 "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/ 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/ rm -v /tmp/lf.tar.gz echo "Installing neovim ..." git clone https://github.com/neovim/neovim /tmp/neovim cd /tmp/neovim make CMAKE_BUILD_TYPE=Release make install 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 exit 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" exit su --login "$user" . ./.profile nvm install --lts --latest-npm exit su --login "$user" . ./.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 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 # TODO wakatime api key echo "Configuring lf .." lf config if [ -e "$_home_dir/.config/lf" ] ; then mv -v "$_home_dir/.config/lf" "$_home_dir/.config/lf-original-$(date +%s)" fi git clone ssh://git@git.rayelliott.dev:3222/dots/lf.git "$_home_dir/.config/lf" EOSSH