-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_once_install-packages.sh.tmpl
98 lines (81 loc) · 3.06 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
{{ if eq .osid "linux-debian" "linux-raspbian" "linux-pop" "linux-ubuntu" -}}
{{ $packages := list
"curl"
"direnv"
"jq"
"make"
"rsync"
"tree"
"ripgrep"
"fzf"
"zsh"
"python3"
"python3-pip"
"fontconfig" -}}
{{ $sudo := "sudo " -}}
{{ if eq .chezmoi.username "root" -}}
{{ $sudo = "" -}}
{{ end -}}
#!/bin/bash
{{ $sudo }}apt-get update
# Install the packages
{{ $sudo }}apt-get install -y {{ $packages | join " " }}
# Install pipx
if ! command -v pipx >/dev/null 2>&1; then
echo 'Installing pipx'
python3 -m pip install --user pipx
python3 -m pipx ensurepath
fi
# Install Poetry
if ! command -v poetry >/dev/null 2>&1; then
echo 'Installing Poetry'
curl -sSL https://install.python-poetry.org | python3 -
fi
{{ if eq .chezmoi.arch "amd64" -}}
# Install Homebrew
command -v brew >/dev/null 2>&1 || \
(echo '🍺 Installing Homebrew' && /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)")
# Set up the environment
test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)"
# Check if chezmoi is installed and install if not
if ! command -v chezmoi >/dev/null 2>&1; then
echo 'Installing chezmoi'
brew install chezmoi
else
echo 'Chezmoi is already installed'
fi
#Install brew packages - https://docs.brew.sh/Homebrew-on-Linux#arm-unsupported - need to check if these are supported on ARM
brew install btop
brew install tldr
{{ end -}}
# Install Oh My Zsh - only checks for the script, which doesn't work with .chexmoiexternal approach... can both be used?
if [ ! -f ~/.oh-my-zsh/oh-my-zsh.sh ]; then
(echo '💰 Installing oh-my-zsh' && yes | sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)")
fi
# Install nerd fonts
NERD='\U1f913'
if [ ! -f ~/.local/share/fonts/'Droid Sans Mono for Powerline Nerd Font Complete.otf' ]; then
mkdir -p ~/.local/share/fonts
cd ~/.local/share/fonts
(echo -e "${NERD} Installing Nerd Fonts" && sh -c "$(curl -fLo 'Droid Sans Mono for Powerline Nerd Font Complete.otf' https://github.com/ryanoasis/nerd-fonts/raw/HEAD/patched-fonts/DroidSansMono/complete/Droid%20Sans%20Mono%20Nerd%20Font%20Complete.otf)")
fi
# Install Meslo Nerd Font
for tff in "MesloLGS NF Regular.ttf" "MesloLGS NF Bold.ttf" "MesloLGS NF Italic.ttf" "MesloLGS NF Bold Italic.ttf"
do
cd ~/.local/share/fonts
font_filename=$(echo $tff|sed -e 's/ //g')
font_urlencoded=$(echo $tff|sed -e 's/ /%20/g')
if [ ! -f $font_filename ]; then
echo curl -fLo $font_filename https://github.com/romkatv/powerlevel10k-media/raw/master/$font_urlencoded
(echo -e "${NERD} Installing font ${tff} for PowerLevel10k" && sh -c "$(curl -fLo $font_filename https://github.com/romkatv/powerlevel10k-media/raw/master/$font_urlencoded)")
fi
done
# Refresh the font cache
fc-cache -f -v ~/.local/share/fonts
# Install antigen
MASK='\U1f637'
if [ ! -f ~/.zsh/antigen/antigen.zsh ]; then
mkdir -p ~/.zsh/antigen
(echo -e "${MASK} Installing Antigen plugin Manager" && sh -c "$(curl -L git.io/antigen > ~/.zsh/antigen/antigen.zsh)")
fi
{{ end -}}