2019-03-26 09:55:52 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-01-19 10:26:40 +00:00
|
|
|
set -e
|
2018-10-15 13:29:14 +01:00
|
|
|
set -o pipefail
|
2014-08-31 07:01:19 +01:00
|
|
|
|
2016-07-30 20:39:07 +01:00
|
|
|
SUDO=""
|
|
|
|
if [[ -z $NOSUDO ]]; then
|
2016-07-30 20:42:34 +01:00
|
|
|
SUDO="sudo"
|
2016-07-30 20:39:07 +01:00
|
|
|
fi
|
|
|
|
|
2015-01-25 08:57:25 +00:00
|
|
|
echo
|
|
|
|
echo "configuring settings common among OSes"
|
2019-01-20 13:29:16 +00:00
|
|
|
echo "using '$SUDO' as sudo"
|
2016-07-30 20:39:07 +01:00
|
|
|
$SUDO true
|
2015-07-19 10:23:35 +01:00
|
|
|
|
2019-01-20 13:40:54 +00:00
|
|
|
echo "linking and sourcing env"
|
|
|
|
ln -vfs "$DIR/.setenv.sh" ~/.setenv
|
2019-01-20 13:29:16 +00:00
|
|
|
source ~/.setenv
|
|
|
|
|
2015-01-25 08:57:25 +00:00
|
|
|
#zsh
|
2015-07-19 10:23:35 +01:00
|
|
|
if [[ -z $DONT_CHANGE_SHELL ]]; then
|
|
|
|
echo "changing shell to zsh"
|
2019-01-19 10:26:40 +00:00
|
|
|
chsh -s `which zsh` $USER
|
2015-07-19 10:23:35 +01:00
|
|
|
fi
|
2014-08-31 07:01:19 +01:00
|
|
|
|
2016-11-03 20:21:29 +00:00
|
|
|
CURL="curl -sSfL"
|
2016-06-04 07:59:40 +01:00
|
|
|
|
2016-07-30 20:08:05 +01:00
|
|
|
if [[ -z $DIR ]]; then
|
|
|
|
echo "please set DIR"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2015-03-28 08:10:58 +00:00
|
|
|
DIR=`realpath $DIR`
|
|
|
|
echo "using $DIR as the top level directory"
|
2014-08-31 07:01:19 +01:00
|
|
|
cd $DIR
|
2015-09-20 10:57:01 +01:00
|
|
|
git submodule update --init --recursive
|
2014-08-31 07:01:19 +01:00
|
|
|
|
2015-03-16 06:01:03 +00:00
|
|
|
#configs
|
2014-12-25 16:17:42 +00:00
|
|
|
ln -vfs "$DIR/.vim" ~/.
|
2018-04-29 21:41:53 +01:00
|
|
|
ln -vfs "$DIR/.ideavimrc" ~/.
|
2019-02-22 15:50:11 +00:00
|
|
|
ln -vfs "$DIR/.vimrc" ~/.vimrc
|
2019-03-04 14:24:33 +00:00
|
|
|
ln -vfs "$DIR/rvmrc" ~/.rvmrc
|
2014-12-25 16:17:42 +00:00
|
|
|
ln -vfs "$DIR/.tmux.conf" ~/.
|
2017-02-12 11:47:30 +00:00
|
|
|
ln -vfs "$DIR/.tmux.macosx" ~/.
|
2014-08-31 07:01:19 +01:00
|
|
|
rm -f "~/.zshrc"
|
2016-11-13 16:09:48 +00:00
|
|
|
ln -vfs "$DIR/.zprezto" ~/.
|
2016-11-13 18:55:32 +00:00
|
|
|
ln -vfs "$DIR/.zpreztorc" ~/.zpreztorc
|
2016-11-13 16:16:45 +00:00
|
|
|
ln -vfs "$DIR/.zprofile" ~/.zprofile
|
2016-11-13 16:09:48 +00:00
|
|
|
ln -vfs "$DIR/.zprezto/runcoms/zshenv" ~/.zshenv
|
2016-11-13 18:55:32 +00:00
|
|
|
ln -vfs "$DIR/.zshrc" ~/.zshrc
|
2017-01-26 05:44:03 +00:00
|
|
|
ln -vfs "$DIR/.hyper.js" ~/.hyper.js
|
|
|
|
ln -vfs "$DIR/.hyper_plugins" ~/.hyper_plugins
|
2019-05-13 10:12:55 +01:00
|
|
|
ln -vfs "$DIR/.hyper_plugins" ~/.hyper_plugins
|
2016-11-13 16:09:48 +00:00
|
|
|
|
2014-12-25 16:17:42 +00:00
|
|
|
ln -vfs "$DIR/.Slic3r" ~/.
|
2015-02-28 21:39:29 +00:00
|
|
|
ln -vfs "$DIR/.ghci" ~/.
|
2016-05-03 19:20:46 +01:00
|
|
|
ln -vfs "$DIR/.conkyrc" ~/.
|
2015-03-11 20:37:36 +00:00
|
|
|
mkdir -p ~/.kde/share/config/
|
|
|
|
ln -vfs "$DIR/.kdiff3rc" ~/.kde/share/config/kdiff3rc
|
2019-05-13 10:12:55 +01:00
|
|
|
|
2014-12-25 16:17:42 +00:00
|
|
|
ln -vfs "$DIR/.gitconfig.linux.private" ~/.gitconfig
|
2019-05-23 15:08:39 +01:00
|
|
|
if [[ `hostname` =~ .*FORM3.* ]]; then
|
2019-05-13 10:12:55 +01:00
|
|
|
ln -vfs "$DIR/.gitconfig.linux.form3" ~/.gitconfig
|
|
|
|
fi
|
|
|
|
|
2015-04-12 18:07:50 +01:00
|
|
|
mkdir -p ~/.config/autostart/
|
2015-10-17 20:05:23 +01:00
|
|
|
# autostart apps
|
2015-07-04 11:12:53 +01:00
|
|
|
mkdir -p ~/.config/vdirsyncer/
|
|
|
|
ln -vfs "$DIR/.config/vdirsyncer/config" ~/.config/vdirsyncer/
|
2016-11-25 20:08:37 +00:00
|
|
|
mkdir -p ~/.config/Code/User
|
2016-11-25 19:05:15 +00:00
|
|
|
ln -vfs "$DIR/.config/Code/User/settings.json" ~/.config/Code/User/settings.json
|
2017-11-03 18:30:53 +00:00
|
|
|
ln -vfs "$DIR/.config/Code/User/keybindings.json" ~/.config/Code/User/keybindings.json
|
2019-01-19 10:26:40 +00:00
|
|
|
mkdir -p ~/.local/share/applications
|
2018-11-17 19:41:41 +00:00
|
|
|
cp -v "$DIR/keeweb.desktop" ~/.local/share/applications/
|
2019-01-20 13:29:16 +00:00
|
|
|
ln -vfs "$DIR/tools" ~/
|
|
|
|
mkdir -vp ~/.config/terminator
|
|
|
|
rm -f ~/.config/terminator/config
|
|
|
|
ln "$DIR/.config/terminator/config" ~/.config/terminator/config
|
2019-05-02 14:56:08 +01:00
|
|
|
mkdir -vp "$HOME/.config/alacritty/"
|
|
|
|
ln -vfs "$DIR/.alacritty.yml" "$HOME/.config/alacritty/alacritty.yml"
|
2018-09-14 08:03:03 +01:00
|
|
|
mkdir -p ~/.cargo/
|
2018-10-15 13:29:14 +01:00
|
|
|
echo "all links done"
|
2015-03-16 06:01:03 +00:00
|
|
|
|
2019-02-05 16:28:29 +00:00
|
|
|
echo "adding GDB dashboard"
|
2019-06-08 09:34:59 +01:00
|
|
|
rm -fr ~/.gdbinit*
|
2019-02-05 16:28:29 +00:00
|
|
|
wget -P ~ git.io/.gdbinit
|
|
|
|
|
2018-10-15 13:29:14 +01:00
|
|
|
echo "adding NVM"
|
2019-01-20 13:51:10 +00:00
|
|
|
mkdir -p "$NVM_DIR"
|
2019-01-19 15:04:47 +00:00
|
|
|
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
|
2018-10-15 13:29:14 +01:00
|
|
|
|
2019-01-20 13:23:31 +00:00
|
|
|
echo "using NVM"
|
|
|
|
set +e
|
2019-01-20 13:09:46 +00:00
|
|
|
\. "$NVM_DIR/nvm.sh"
|
2019-01-20 13:23:31 +00:00
|
|
|
set -e
|
|
|
|
nvm install node
|
2019-01-19 14:07:38 +00:00
|
|
|
nvm use node
|
2015-08-01 08:20:19 +01:00
|
|
|
|
2014-08-31 07:01:19 +01:00
|
|
|
#install fonts
|
2019-01-20 13:29:16 +00:00
|
|
|
echo "installing fonts"
|
2015-07-31 19:25:32 +01:00
|
|
|
mkdir -p ~/.fonts
|
2014-08-31 07:01:19 +01:00
|
|
|
cp -rv "$DIR/fonts" ~/.fonts
|
2016-02-15 16:07:34 +00:00
|
|
|
set +e
|
2016-01-30 10:37:33 +00:00
|
|
|
fc-cache -rv
|
2016-07-30 20:39:07 +01:00
|
|
|
$SUDO fc-cache -rv
|
2016-02-15 16:07:34 +00:00
|
|
|
set -e
|
2014-08-31 07:01:19 +01:00
|
|
|
|
2016-07-31 08:43:37 +01:00
|
|
|
if [[ -z $NORUST ]]; then
|
|
|
|
#rust
|
|
|
|
echo "installing rust"
|
|
|
|
RUSTUP_TEMP="/tmp/blastoff.sh"
|
|
|
|
$CURL https://sh.rustup.rs > "$RUSTUP_TEMP"
|
|
|
|
chmod a+x "$RUSTUP_TEMP"
|
|
|
|
"$RUSTUP_TEMP" -y
|
|
|
|
rm -f "$RUSTUP_TEMP"
|
2019-01-20 14:05:01 +00:00
|
|
|
|
|
|
|
set +e
|
2016-07-31 08:43:37 +01:00
|
|
|
rustup update
|
2019-01-20 14:05:01 +00:00
|
|
|
set -e
|
2018-01-13 11:00:26 +00:00
|
|
|
rustup install stable
|
2019-01-20 14:05:01 +00:00
|
|
|
set +e
|
2018-01-13 11:00:26 +00:00
|
|
|
rustup install nightly
|
2019-01-20 14:05:01 +00:00
|
|
|
set -e
|
2016-07-31 08:43:37 +01:00
|
|
|
rustup default stable
|
2018-06-03 12:03:17 +01:00
|
|
|
|
2019-01-20 13:32:33 +00:00
|
|
|
rustup component add rls --toolchain stable
|
|
|
|
rustup component add clippy --toolchain stable
|
|
|
|
rustup component add rustfmt --toolchain stable
|
2018-05-27 23:56:28 +01:00
|
|
|
rustup component add rust-analysis --toolchain stable
|
|
|
|
rustup component add rust-src --toolchain stable
|
2019-01-19 10:26:40 +00:00
|
|
|
|
2019-01-20 14:05:01 +00:00
|
|
|
set +e
|
|
|
|
rustup component add rls --toolchain nightly
|
|
|
|
rustup component add clippy --toolchain nightly
|
|
|
|
rustup component add rustfmt --toolchain nightly
|
2019-01-19 10:26:40 +00:00
|
|
|
rustup component add rust-analysis --toolchain nightly
|
2018-05-27 23:56:28 +01:00
|
|
|
rustup component add rust-src --toolchain nightly
|
2019-01-20 14:05:01 +00:00
|
|
|
set -e
|
2018-05-27 23:56:28 +01:00
|
|
|
|
2016-07-31 08:43:37 +01:00
|
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
|
2017-10-16 20:02:25 +01:00
|
|
|
|
2019-01-20 14:21:39 +00:00
|
|
|
(test -x "${HOME}/.cargo/bin/cargo-install-update" || cargo install cargo-update)
|
|
|
|
(test -x "${HOME}/.cargo/bin/rg" || cargo install ripgrep)
|
|
|
|
(test -x "${HOME}/.cargo/bin/fd" || cargo install fd-find)
|
2019-06-08 11:17:47 +01:00
|
|
|
(test -x "${HOME}/.cargo/bin/bat" || cargo install bat)
|
2019-01-20 14:21:39 +00:00
|
|
|
(test -x "${HOME}/.cargo/bin/genpass" || cargo install genpass)
|
|
|
|
|
2017-10-16 20:02:25 +01:00
|
|
|
set +e
|
2018-06-03 17:10:28 +01:00
|
|
|
cargo install-update -a
|
2018-06-09 11:18:45 +01:00
|
|
|
set -e
|
|
|
|
rustup run nightly cargo install-update -a
|
2015-07-31 19:25:32 +01:00
|
|
|
fi
|
2015-07-19 08:56:32 +01:00
|
|
|
|
2016-11-01 13:35:53 +00:00
|
|
|
set +e
|
|
|
|
echo "Querying for gpg2 path"
|
|
|
|
gpg2_path=`which gpg2`
|
|
|
|
echo "Got $gpg2_path for gpg2 path"
|
2016-11-01 13:38:20 +00:00
|
|
|
set -e
|
2019-01-19 10:26:40 +00:00
|
|
|
if [[ -x "$gpg2_path" ]]; then
|
2016-11-01 13:35:53 +00:00
|
|
|
echo "Using gpg2"
|
|
|
|
GPG=gpg2
|
|
|
|
else
|
|
|
|
echo "WARNING using gpg instead of gpg2"
|
|
|
|
GPG=gpg
|
|
|
|
fi
|
|
|
|
|
2019-03-18 13:56:43 +00:00
|
|
|
echo "Getting GPG keys.."
|
|
|
|
for key in \
|
|
|
|
409B6B1796C275462A1703113804BB82D39DC0E3 \
|
|
|
|
7D2BAF1CF37B13E2069D6956105BD0E739499BDB
|
2019-05-02 14:56:08 +01:00
|
|
|
do
|
2019-03-18 13:56:43 +00:00
|
|
|
$GPG --keyserver hkp://keys.gnupg.net --recv-keys "$key" || \
|
|
|
|
$GPG --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \
|
|
|
|
$GPG --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \
|
2019-03-18 16:28:56 +00:00
|
|
|
$GPG --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" \
|
|
|
|
;
|
2019-03-18 13:56:43 +00:00
|
|
|
done
|
|
|
|
|
2016-08-11 13:37:03 +01:00
|
|
|
if [[ -z $NORUBY ]]; then
|
2016-11-03 20:12:59 +00:00
|
|
|
echo "Downloading RVM..."
|
2016-11-03 20:18:13 +00:00
|
|
|
$CURL https://get.rvm.io | bash
|
2016-11-02 19:42:28 +00:00
|
|
|
set +e
|
2016-11-03 20:12:59 +00:00
|
|
|
echo "Sourcing RVM..."
|
2016-11-02 19:42:28 +00:00
|
|
|
source /usr/local/rvm/scripts/rvm
|
2016-11-01 19:14:18 +00:00
|
|
|
source ~/.rvm/scripts/rvm
|
2016-11-02 19:42:28 +00:00
|
|
|
set -e
|
2016-11-03 20:12:59 +00:00
|
|
|
echo "Installing Ruby..."
|
2017-01-24 19:53:30 +00:00
|
|
|
rvm install ruby --disable-binary
|
2016-08-11 13:37:03 +01:00
|
|
|
fi
|
2016-04-30 09:46:06 +01:00
|
|
|
|
2019-06-08 12:36:44 +01:00
|
|
|
# go
|
2019-06-08 12:10:54 +01:00
|
|
|
if [[ -z $NO_GO ]]; then
|
|
|
|
GOPATH="$HOME/go"
|
|
|
|
export GOPATH=`realpath "$GOPATH"`
|
|
|
|
mkdir -p "$GOPATH"
|
|
|
|
|
|
|
|
# excercism
|
|
|
|
go get -u -t github.com/exercism/cli/exercism
|
|
|
|
go get -u -t golang.org/x/tools/cmd/gopls
|
|
|
|
fi
|
|
|
|
|
2019-06-08 12:36:44 +01:00
|
|
|
# lua
|
|
|
|
luarocks install --local --server=http://luarocks.org/dev lua-lsp
|
|
|
|
luarocks install --local luacheck
|
|
|
|
|
2016-08-05 08:56:31 +01:00
|
|
|
if [[ -z $NOVIM ]]; then
|
2016-10-13 15:44:59 +01:00
|
|
|
if [[ ! -d ~/.fzf ]]; then
|
|
|
|
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
|
|
|
|
else
|
|
|
|
cd ~/.fzf
|
|
|
|
git pull
|
|
|
|
git submodule update --init --recursive
|
|
|
|
fi
|
2017-05-14 13:05:54 +01:00
|
|
|
if [[ -z $NO_GO ]]; then
|
|
|
|
echo "Installing fzf"
|
|
|
|
~/.fzf/install --64 --all
|
|
|
|
fi
|
2016-11-01 13:22:07 +00:00
|
|
|
echo "Installing Vim plugins"
|
2019-06-08 11:17:47 +01:00
|
|
|
vim +PlugUpgrade +qa
|
|
|
|
vim +PlugUpdate +qa
|
|
|
|
vim +PlugClean! +qa
|
2016-07-31 08:43:37 +01:00
|
|
|
fi
|
2014-12-25 16:17:42 +00:00
|
|
|
|
2019-01-20 14:46:09 +00:00
|
|
|
nvm use node
|
2019-06-08 12:10:54 +01:00
|
|
|
npx npm install -g yarn
|
2019-06-08 09:34:59 +01:00
|
|
|
npx npm install -g reveal-md
|
|
|
|
npx npm install -g diff-so-fancy
|
|
|
|
npx npm install -g cssnano
|
2015-08-18 17:47:25 +01:00
|
|
|
|
2014-08-31 07:01:19 +01:00
|
|
|
echo
|
2015-01-25 08:58:43 +00:00
|
|
|
echo "now go ahead and restart"
|
|
|
|
echo
|
|
|
|
|