-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinstall.sh
executable file
·106 lines (92 loc) · 2.32 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/bin/bash
# log all the things
exec > >(tee -i $HOME/dotfiles_install.log)
exec 2>&1
set -x
dotfiles_dir=$(pwd)
os=$(uname -s)
mkdir -p ~/bin
# Install packages
if [ "$os" == "Darwin" ]; then
brew bundle
else
# already zsh by default on macos these days
# switch shells
sudo chsh -s "$(which zsh)" "$(whoami)"
sudo apt-get update -y
sudo apt-get install -y \
ack \
fd-find \
fuse \
fzf \
fuse \
jq \
libfuse2 \
neovim \
netcat \
socat \
ripgrep \
ruby-dev \
socat \
tree \
universal-ctags \
yamllint
# https://github.com/sharkdp/fd#on-ubuntu
ln -s $(which fdfind) ~/bin/fd
curl -L -o $HOME/bin/nvim https://github.com/neovim/neovim/releases/download/stable/nvim.appimage
chmod a+x $HOME/bin/nvim
fi
if [ "$CODESPACES" = true ] ; then
# make clipper stale socket cleanup work after disconnects
if grep -qxF 'StreamLocalBindUnlink yes' /etc/ssh/sshd_config; then
echo 'sshd StreamLocalBindUnlink already set'
else
echo 'StreamLocalBindUnlink yes' | sudo tee -a /etc/ssh/sshd_config
sudo pkill -HUP -F /var/run/sshd.pid
echo 'StreamLocalBindUnlink set for sshd_config'
fi
# makes it possible to forward my private GPG key via SSH https://wiki.gnupg.org/AgentForwarding
gpg --import mattrobinson.gpg.pub
fi
mkdir $HOME/.config
# symlink files
declare -a ln_files=(
.ackrc
.clipper.json
.config/nvim
.ctags.d
.ctags
.editrc
.gemrc
.git-completion.sh
.gitconfig
.gitconfig-github
.gitignore
.gnupg/gpg-agent.conf
.inputrc
.rgconfig
.sh_aliases
.shrc
.tmux.conf
.vim
.vimrc
.zprofile
.zshenv
.zshrc
)
for link_file in "${ln_files[@]}"; do
ln -sfn $dotfiles_dir/$link_file $HOME/$link_file
done
# Install vim plugins
# extra flags to ignore startup errors
# https://stackoverflow.com/questions/54606581/ignore-all-errors-in-vimrc-at-vim-startup
vim -E -s -u ~/.vimrc +PlugInstall +qall
# hacky, probably a better way, but I want this for my prompt
if [ ! -f ~/.codespace_created_at ]; then
echo $(date +'%Y%m%d-%H%M') > ~/.codespace_created_at
fi
# nvm was easier to install than nodenv ¯\_(ツ)_/¯
# need newer version to run copilot on nvim
# Node.js version 16.x or newer required but found 12.22.12
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
nvm install 18.13.0