-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.zsh
executable file
·175 lines (122 loc) · 3.66 KB
/
install.zsh
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#!/usr/bin/env zsh
set -e -o verbose
# env
export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config}
export XDG_CACHE_HOME=${XDG_CACHE_HOME:-~/.cache}
export XDG_DATA_HOME=${XDG_DATA_HOME:-~/.local/share}
# dirs
[[ -d $XDG_CONFIG_HOME ]] || mkdir -p $XDG_CONFIG_HOME
[[ -d $XDG_CACHE_HOME ]] || mkdir -p $XDG_CACHE_HOME
[[ -d $XDG_DATA_HOME ]] || mkdir -p $XDG_DATA_HOME
# zsh
export ZDOTDIR=$XDG_CONFIG_HOME/zsh
[[ -d $XDG_DATA_HOME/zinit ]] && rm -rf $XDG_DATA_HOME/zinit
mkdir -p $XDG_DATA_HOME/zinit
git clone https://github.com/zdharma-continuum/zinit.git $XDG_DATA_HOME/zinit/bin
export TMUX=1
zsh -c "source $XDG_CONFIG_HOME/zsh/.zshrc && exit"
unset TMUX
# tmux
[[ -d $XDG_DATA_HOME/tmux ]] && rm -rf $XDG_DATA_HOME/tmux
mkdir -p $XDG_DATA_HOME/tmux/plugins
git clone https://github.com/tmux-plugins/tpm $XDG_DATA_HOME/tmux/plugins/tpm
tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf new-session -d
$XDG_DATA_HOME/tmux/plugins/tpm/bindings/install_plugins
tmux kill-server
# gnupg
# export GNUPGHOME=$XDG_DATA_HOME/gnupg
# [[ -d $GNUPGHOME ]] && rm -rf $GNUPGHOME
# mkdir $GNUPGHOME && chmod 700 $GNUPGHOME
# gpg --batch --passphrase '' --quick-gen-key grzegorz.kozub@gmail.com rsa auth,encr,sign never
# gpg --batch --generate-key <<EOF
# %no-protection
# Key-Type: rsa
# Key-Length: 3072
# Key-Usage: auth,encr,sign
# Name-Real: Grzegorz Kozub
# Name-Email: grzegorz.kozub@gmail.com
# EOF
# pass
export PASSWORD_STORE_DIR=$XDG_DATA_HOME/pass
[[ -d $PASSWORD_STORE_DIR ]] && rm -rf $PASSWORD_STORE_DIR
pass init grzegorz.kozub@gmail.com
# shared
. `dirname $0`/shared.zsh
# bat
bat cache --build
# node
export NPM_CONFIG_CACHE=$XDG_CACHE_HOME/npm
export NPM_CONFIG_USERCONFIG=$XDG_CONFIG_HOME/npm/npmrc
# export NPM_CONFIG_PREFIX=$XDG_DATA_HOME/npm
# nvm install node --latest-npm
# nvm install-latest-npm
# nvm cache clear
fnm install --latest
fnm use default
npm install --global \
eslint \
neovim \
tsx \
typescript
# artillery autocannon mdpdf
# rust
export CARGO_HOME=$XDG_DATA_HOME/cargo
# https://github.com/nabijaczleweli/cargo-update/issues/243
cargo install \
cargo-update \
--force --features vendored-libgit2 --features vendored-openssl
cargo install \
jwt-cli
# neovim
# nvim -c 'autocmd User VeryLazy lua require("lazy").load({ plugins = { "mason-lspconfig.nvim", "mason-null-ls.nvim" } })'
nvim -c 'autocmd User MasonToolsUpdateCompleted quitall' -c 'autocmd User VeryLazy MasonToolsUpdate'
# silicon
pushd $XDG_CONFIG_HOME/silicon
[[ -d syntaxes ]] || mkdir syntaxes
silicon --build-cache
popd
# vscode
for EXTENSION in \
antfu.icons-carbon \
bierner.markdown-mermaid \
CucumberOpen.cucumber-official \
dbaeumer.vscode-eslint \
editorconfig.editorconfig \
esbenp.prettier-vscode \
golang.Go \
kddejong.vscode-cfn-lint \
ms-azuretools.vscode-docker \
ms-dotnettools.csdevkit \
ms-dotnettools.csharp \
ms-dotnettools.vscode-dotnet-runtime \
ms-python.black-formatter \
ms-python.debugpy \
ms-python.isort \
ms-python.python \
ms-python.pylint \
ms-python.vscode-pylance \
pkief.material-icon-theme \
redhat.vscode-yaml \
sainnhe.gruvbox-material \
streetsidesoftware.code-spell-checker \
sumneko.lua
do
code --install-extension $EXTENSION --force
done
# asvetliakov.vscode-neovim JakeBecker.elixir-ls
# docker
docker run --privileged --rm tonistiigi/binfmt --install arm64
docker rmi $(docker images tonistiigi/binfmt -a -q)
docker buildx create --name builder --use
# yazi
FILE=$XDG_CONFIG_HOME/yazi/package.toml
[[ -f $FILE ]] && rm -f $FILE
for PLUGIN in \
GrzegorzKozub/mdcat \
KKV9/compress \
Tyarel8/video-ffmpeg \
yazi-rs/plugins:git \
yazi-rs/plugins:jump-to-char
do
ya pack --add "$PLUGIN"
done