-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpost-install
executable file
·90 lines (70 loc) · 2.43 KB
/
post-install
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
#!/usr/bin/env bash
#
# Perform post-installation configuration.
#
# XXX(ndhoule): This script isn't yet tested; it currently serves mostly to document as-of-yet
# uncaptured setup steps.
#
set -o errexit
set -o nounset
set -o pipefail
log_info() {
printf "[INFO]: %s\n" "$*"
}
log_warn() {
printf "[WARN]: %s\n" "$*" >&2
}
log_error() {
printf "[ERROR]: %s\n" "$*" >&2
}
# TODO: Move dotfile symlinking to this script, stow won't be present on Fedora Silverblue systems until reboot
if command -v zsh > /dev/null 2>&1 && [[ "$(getent passwd "$(whoami)" | awk -F : '{print $NF}' | rev | cut -d '/' -f 1 | rev)" != "zsh" ]]; then
chsh --shell "$(which zsh)"
log_info "The user shell has been changed to zsh. Please restart your session for changes to take effect, and then re-run this script."
exit 0
fi
#
# Install shell plugins
#
if command -v antidote > /dev/null 2>&1; then
antidote bundle
else
log_warn "\`antidote\` not found in \$PATH. Skipping zsh plugin installation."
fi
#
# Install language runtimes
#
ASDF_DIR="${ASDF_DIR:-"${HOME}/.asdf"}"
# FIXME(ndhoule): This isn't exactly right but whatever. It assumes that there's no system asdf
# install available and that the user wants a local install, which may not be right but again who
# cares right now
if [ ! -d "${ASDF_DIR}" ]; then
git clone https://github.com/asdf-vm/asdf.git "${ASDF_DIR}" --branch v0.13.1 || echo "test"
fi
if ! command -v asdf > /dev/null 2>&1; then
source "${ASDF_DIR}/asdf.sh"
fi
if command -v asdf > /dev/null 2>&1; then
asdf plugin add deno
asdf plugin add golang
asdf plugin add nodejs
asdf plugin add python
asdf install
else
log_warn "\`asdf\` not found in \$PATH. Skipping tool installation."
fi
# FIXME(ndhoule): This relies on Packer being installed already I think
if command -v nvim > /dev/null 2>&1; then
if test -e "${XDG_CONFIG_HOME}/nvim/plugin/packer_compiled.lua"; then
rm "${XDG_CONFIG_HOME}/nvim/plugin/packer_compiled.lua"
fi
if ! test -d "${XDG_DATA_HOME}/site/pack/packer/start/packer.nvim"; then
git clone https://github.com/wbthomason/packer.nvim "${XDG_DATA_HOME}/site/pack/packer/start/packer.nvim"
fi
nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
# TODO(ndhoule): :TSInstallSync
fi
if ! test -d "${XDG_DATA_HOME}/firefoxpwa/runtime" && command -v firefoxpwa > /dev/null 2>&1; then
firefoxpwa runtime install
fi
"${HOME}/.cache/tmux/plugins/tpm/scripts/install_plugins.sh"