#!/bin/sh

set -e

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/opt/homebrew/bin/brew shellenv)"
brew install \
  age \
  bzip2 \
  cmus \
  curl \
  direnv \
  fzf \
  gh \
  git \
  git-delta \
  glow \
  helix \
  jj \
  kitty \
  marksman \
  nvm \
  presenterm \
  ripgrep \
  sqlite \
  tree \
  watch \
  wget \
  xz \
  yazi \
  zellij \
  zk \
  zlib

brew install --cask \
  kap

export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh"
nvm install 22
nvm use 22

curl -LsSf https://astral.sh/uv/install.sh | sh
uv tool install --force --python python3.12 aider-chat@latest

{{ if eq .hosttype "personal" -}}
brew install \
  mingw-w64 \
  pandoc
{{ else if eq .hosttype "work" -}}
  {{ join .chezmoi.sourceDir "encrypted_dot_work_packages.age" | include | decrypt -}}
{{ end }}