-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_once_install-packages.sh.tmpl
50 lines (44 loc) · 1.68 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
#!/bin/sh
# Install used programs
PACKAGES="exa neovim tmux zsh"
{{ if eq .chezmoi.os "linux" -}}
DNF_CMD=$(which yum)
APT_GET_CMD=$(which apt-get)
if [[ ! -z $DNF_CMD ]]; then
# Fedora
DNF_PACKAGES=$PACKAGES
sudo dnf install $DNF_PACKAGES
elif [[ ! -z $APT_GET_CMD ]]; then
# Ubuntu / Debian
APT_GET_PACKAGES=$PACKAGES
sudo apt-get install $APT_GET_PACKAGES
else
echo "This platform is currently not supported for package installs.\n Manually install the following pages:\n"
for PACKAGE in PACKAGES; do
echo $PACKAGE
done
exit 1;
fi
{{ else if eq .chezmoi.os "darwin" -}}
# MacOS
# Install brew
/bin/bash -c "$(curl -fsSL https://github.com/raw/Homebrew/install/HEAD/install.sh)"
BREW_PACKAGES=$PACKAGES
brew install $BREW_PACKAGES
{{ end -}}
# Install nvm
NVM_URL="https://github.com/raw/nvm-sh/nvm/master/install.sh"
curl -o- $NVM_URL | bash
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# Install node
nvm install --lts
# Set up zsh
sudo sh -c "echo $(which zsh) >> /etc/shells"
chsh -s $(which zsh)
# Install oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --keep-zshrc --unattended || true
# Install zsh-autosuggestions plugin for oh-my-zsh
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# Install zsh-syntax-highlighting plugin for oh-my-zsh
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting