-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_once_brew.sh.tmpl
More file actions
63 lines (53 loc) · 1.65 KB
/
run_once_brew.sh.tmpl
File metadata and controls
63 lines (53 loc) · 1.65 KB
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
#!/usr/bin/env -S bash -x
{{ if (eq .chezmoi.os "darwin") }}
if test ! $(which brew); then
printf '\e[33mHomebrew not found. \e[0mInstalling Homebrew...\n'
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
eval "$(/opt/homebrew/bin/brew shellenv)"
else
printf 'Homebrew found. Continuing...\n'
fi
printf 'Installing Homebrew packages...\n'
brew bundle --file=/dev/stdin <<EOF
brew "fd"
brew "fzf"
brew "gh"
brew "jj"
brew "jq"
brew "starship"
brew "trash"
brew "wget"
brew "git"
brew "zsh-autosuggestions"
brew "zsh-syntax-highlighting"
cask "font-jetbrains-mono-nerd-font"
EOF
{{ else if (eq .chezmoi.os "linux") }}
printf 'Installing apt-get packages...\n'
sudo apt-get install -y \
fd-find \
fzf \
gh \
jq \
wget \
git \
zsh-autosuggestions \
zsh-syntax-highlighting
printf 'Installing starship...\n'
curl -sS https://starship.rs/install.sh | sh -s -- -y
printf 'Installing jj...\n'
gh release download --repo jj-vcs/jj --pattern '*x86_64-unknown-linux-musl.tar.gz' --dir /tmp --clobber
sudo tar xzf /tmp/jj-*-x86_64-unknown-linux-musl.tar.gz -C /usr/local/bin --strip-components=1 --wildcards '*/jj'
rm -f /tmp/jj-*-x86_64-unknown-linux-musl.tar.gz
{{ end -}}
if [[ -n "${CODESPACE_VSCODE_FOLDER}" ]]; then
printf "Setting up commit-graph in ${CODESPACE_VSCODE_FOLDER}"
(cd $CODESPACE_VSCODE_FOLDER; git commit-graph write --reachable --changed-paths)
fi
# Set zsh as my default shell:
{{ if (eq .chezmoi.os "linux") }}
printf 'Setting zsh as shell'
if [[ -n "$(grep $(whoami) /etc/passwd)" ]] && ! grep -q "$(whoami).*/bin/zsh" /etc/passwd; then
sudo chsh -s /bin/zsh $(whoami)
fi
{{ end -}}