-
Notifications
You must be signed in to change notification settings - Fork 2
/
run_once_install-packages.sh.tmpl
executable file
·102 lines (88 loc) · 4.75 KB
/
run_once_install-packages.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
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
#!/usr/bin/env bash
set -o xtrace -o errexit
if [ ! -f $HOME/.pixi/bin/pixi ]; then
curl -fsSL https://pixi.sh/install.sh | bash
if [ ! -f $HOME/.bashrc ]; then
echo 'PATH="${HOME}/.pixi/bin:${PATH}"' >> .bashrc
fi
fi
export PATH="$HOME/.pixi/bin:${PATH}"
if [ -d ${HOME}/.pixi/envs ]; then
ls ${HOME}/.pixi/envs > /tmp/installed_packages
else
touch /tmp/installed_packages
fi
comm -13 <(sort -u /tmp/installed_packages) <(sort -u $HOME/.local/share/chezmoi/dot_config/chezmoi/package_list) | xargs -I % pixi global install -c dnachun -c conda-forge %
{{ if eq .chezmoi.os "linux" -}}
comm -13 <(sort -u /tmp/installed_packages) <(sort -u $HOME/.local/share/chezmoi/dot_config/chezmoi/linux_packages) | xargs -I % pixi global install -c dnachun -c conda-forge %
{{ end }}
{{ if eq .chezmoi.os "darwin" -}}
comm -13 <(sort -u /tmp/installed_packages) <(sort -u $HOME/.local/share/chezmoi/dot_config/chezmoi/macos_packages) | xargs -I % pixi global install -c dnachun -c conda-forge %
brew bundle install --file=$HOME/.local/share/chezmoi/dot_config/chezmoi/Brewfile_casks
export FULL_INSTALL=1
{{ end }}
if [ ! -z ${FULL_INSTALL} ]; then
comm -13 <(sort -u /tmp/installed_packages) <(sort -u $HOME/.local/share/chezmoi/dot_config/chezmoi/large_packages) | xargs -I % pixi global install -c dnachun -c conda-forge %
comm -13 <(sort -u /tmp/installed_packages) <(sort -u $HOME/.local/share/chezmoi/dot_config/chezmoi/huge_packages) | xargs -I % pixi global install -c dnachun -c conda-forge %
fi
{{ if eq .chezmoi.arch "amd64" -}}
comm -13 <(sort -u /tmp/installed_packages) <(sort -u $HOME/.local/share/chezmoi/dot_config/chezmoi/intel_packages) | xargs -I % pixi global install -c dnachun -c conda-forge %
{{ end }}
micromamba shell init --shell=bash $HOME/micromamba
micromamba shell init --shell zsh
micromamba config prepend channels nodefaults
micromamba config prepend channels bioconda
micromamba config prepend channels conda-forge
micromamba config prepend channels dnachun
if [ -z $(micromamba env list | grep micromamba | cut -f 3 -d ' ' | grep '^r$') ]; then
micromamba create -n r
fi
micromamba install -n r r-languageserver r-colorout conda-tree
{{ if eq .chezmoi.os "linux" -}}
ln -sf ${HOME}/.pixi/bin/r ${HOME}/.pixi/bin/R
ln -sf ${HOME}/.pixi/bin/rscript ${HOME}/.pixi/bin/Rscript
{{ end }}
if [ -z $(micromamba env list | grep micromamba | cut -f 3 -d ' ' | grep '^python_libs$') ]; then
micromamba create -n python_libs
fi
micromamba install -n python_libs conda-tree ipython
cp ${HOME}/.local/share/chezmoi/dot_config/chezmoi/Rprofile ${HOME}/.pixi/envs/r-base/lib/R/etc/Rprofile.site
tee ${HOME}/.pixi/envs/python/lib/python3.12/site-packages/sitecustomize.py << EOF
import sys
sys.path[0:0] = [
"${HOME}/micromamba/envs/python_libs/lib/python3.12/site-packages"
]
EOF
ln -f ${HOME}/.pixi/envs/python/lib/python3.12/site-packages/sitecustomize.py ${HOME}/.pixi/envs/nbconvert-core/lib/python3.12/site-packages/
ln -f ${HOME}/.pixi/envs/python/lib/python3.12/site-packages/sitecustomize.py ${HOME}/.pixi/envs/notebook/lib/python3.12/site-packages/
ln -f ${HOME}/.pixi/envs/python/lib/python3.12/site-packages/sitecustomize.py ${HOME}/.pixi/envs/jupyter_client/lib/python3.12/site-packages/
ln -f ${HOME}/.pixi/envs/python/lib/python3.12/site-packages/sitecustomize.py ${HOME}/.pixi/envs/jupyter_core/lib/python3.12/site-packages/
ln -f ${HOME}/.pixi/envs/python/lib/python3.12/site-packages/sitecustomize.py ${HOME}/.pixi/envs/jupyter_server/lib/python3.12/site-packages/
ln -f ${HOME}/.pixi/envs/python/lib/python3.12/site-packages/sitecustomize.py ${HOME}/.pixi/envs/jupyterlab/lib/python3.12/site-packages/
ln -f ${HOME}/.pixi/envs/python/lib/python3.12/site-packages/sitecustomize.py ${HOME}/.pixi/envs/sos/lib/python3.12/site-packages/
ln -f ${HOME}/.pixi/envs/python/lib/python3.12/site-packages/sitecustomize.py ${HOME}/.pixi/envs/ptpython/lib/python3.12/site-packages/
# To add
# citation-langserver
# languagetool-code-comments
# ltrs
# pick
# uutils-coreutils
# uutils-findutils
# skywalking-eyes
# Install
if [ ! -d $HOME/.local/share/zinit ]; then
export NO_INPUT=1
export NO_ANNEXES=1
bash -c "$(curl --fail --show-error --silent --location https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh)"
zsh -c "source $HOME/.zshrc"
fi
if [ ! -d $HOME/.config/base16-shell ]; then
git clone https://github.com/chriskempson/base16-shell.git $HOME/.config/base16-shell
fi
if [ ! -d $HOME/.tmux/plugins/tpm ]; then
git clone https://github.com/tmux-plugins/tpm $HOME/.tmux/plugins/tpm
$HOME/.tmux/plugins/tpm/bin/install_plugins
fi
if [ ! -d $HOME/.config/ranger/plugins/ranger_devicons ]; then
git clone https://github.com/alexanderjeurissen/ranger_devicons $HOME/.config/ranger/plugins/ranger_devicons
fi