-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_onchange_after_package-installer.sh.tmpl
57 lines (48 loc) · 1.68 KB
/
run_onchange_after_package-installer.sh.tmpl
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
#!/bin/bash
# ensure its a rdev machine
{{- if (and (eq .chezmoi.os "linux") (eq "mariner" .chezmoi.osRelease.id) (contains "rdev" (env "RDEV_ID")) (eq "coder" .chezmoi.username)) }}
curl -fsSL https://pixi.sh/install.sh | bash
packages=("nvim" "ripgrep" "fzf" "fd-find" "lazygit" "zoxide" "eza" "git-delta" "bat" "tldr" "jq" "yq" "sqlite" "lua" "luajit" "luarocks")
for package in "${packages[@]}"; do
$HOME/.pixi/bin/pixi global install "$package"
done
{{- else }}
# use devox only on mac or linux but not on rdev
if [[ ! $(command -v devbox 2>/dev/null) ]]; then
curl -fsSL https://get.jetify.com/devbox | bash
fi
eval "$(devbox global shellenv --preserve-path-stack -r)" && hash -r 2>/dev/null
{{- end }}
if [[ ! -d $HOME/.nvim-env ]]; then
if [[ -f /export/apps/python/3.10/bin/python3 ]]; then
/export/apps/python/3.10/bin/python3 -m venv "$HOME"/.nvim-env
"$HOME"/.nvim-env/bin/python -m pip install neovim
fi
fi
setup_shell() {
# install powerlevel10k
if [[ ! -d $HOME/powerlevel10k ]]; then
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
fi
# install zsh plugins
PLUGIN_DIR="$HOME/.zsh/plugins"
if [[ ! -d "$PLUGIN_DIR" ]]; then
mkdir -p "$PLUGIN_DIR"
fi
PLUGINS=(
zdharma-continuum/fast-syntax-highlighting
zsh-users/zsh-autosuggestions
zsh-users/zsh-completions
zsh-users/zsh-history-substring-search
Aloxaf/fzf-tab
jeffreytse/zsh-vi-mode
)
for plugin in "${PLUGINS[@]}"; do
local plugin_name=$(basename "$plugin")
local plugin_path="${PLUGIN_DIR}/$plugin_name"
if [[ ! -d "$plugin_path" ]]; then
git clone https://github.com/"$plugin" "$plugin_path"
fi
done
}
setup_shell