feat(sofmani): update installer

This commit is contained in:
Chen Asraf
2025-01-12 17:48:41 +02:00
parent ae5abb699b
commit 1b86a6535d
2 changed files with 390 additions and 292 deletions

View File

@@ -34,6 +34,64 @@ install:
echo $duid >$DOTFILES/.device_uid
echo_cyan "Device UID set to \"$duid\""
- name: git-gpg
type: shell
check_installed: 'gpg --list-keys | grep -q "$GITHUB_GPG_KEY_ID"'
opts:
command: curl https://github.com/web-flow.gpg | gpg --import
- name: git-config
type: shell
check_installed: git config --global user.name && git config --global user.email && git config --global user.signingkey
opts:
command: |
git config --global user.signingkey "~/.ssh/id_casraf.pub"
git config --global filter.lfs.clean "git-lfs clean -- %f"
git config --global filter.lfs.smudge "git-lfs smudge -- %f"
git config --global filter.lfs.process "git-lfs filter-process"
git config --global filter.lfs.required true
git config --global init.defaultBranch "master"
git config --global credential.helper "store"
git config --global pull.rebase true
git config --global core.excludesfile "~/.config/.gitignore"
# git config --global core.untrackedCache true
# git config --global core.fsmonitor true
git config --global rerere.enabled true
git config --global gpg.format "ssh"
git config --global gpg.ssh.allowedSignersFile "~/.ssh/allowed_signers"
git config --global commit.gpgsign true
git config --global maintenance.repo "~/.dotfiles"
git config --global fetch.writeCommitGraph true
git config --global log.showSignature true
git config --global core.excludesfile ~/.config/.gitignore
# ================================================================================================
# Aliases/Custom commands
# ================================================================================================
# Change status
git config --global alias.unchanged "update-index --assume-unchanged"
git config --global alias.changed "update-index --no-assume-unchanged"
git config --global alias.show-unchanged "!git ls-files -v | sed -e 's/^[a-z] //p; d'"
git config --global alias.list-aliases "!git config --global --list | grep --color alias\. | grep -v list-aliases | sed \"s/alias\./\$(tput setaf 1)/\" | sed \"s/=/\$(tput sgr0)=/\""
# Delta Pager
git config --global core.pager delta
git config --global interactive.diffFilter "delta --color-only"
# git config --global delta.side-by-side true
# git config --global delta.navigate true
# git config --global delta.dark true
git config --global merge.conflictStyle diff3
git config --global delta.line-numbers true
git config --global diff.colorMoved default
- name: osx-defaults
type: shell
platforms:
only: ['macos']
opts:
command: |
defaults write -g PMPrintingExpandedStateForPrint -bool TRUE
defaults write -g NSScrollViewRubberbanding -bool FALSE
- name: nvim
type: rsync
@@ -96,6 +154,7 @@ install:
curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${VERSION}_Linux_x86_64.tar.gz"
tar xf lazygit.tar.gz lazygit
sudo install lazygit /usr/local/bin
rm -rf lazygit.tar.gz lazygit
- name: lazydocker
type: group
steps:
@@ -114,6 +173,7 @@ install:
curl -Lo lazydocker.tar.gz "https://github.com/jesseduffield/lazydocker/releases/latest/download/lazydocker_${VERSION}_Linux_x86_64.tar.gz"
tar xf lazydocker.tar.gz lazydocker
sudo install lazydocker /usr/local/bin
rm -rf lazydocker.tar.gz lazydocker
- name: delta
type: group
steps:
@@ -154,6 +214,22 @@ install:
type: apt
platforms:
only: ['linux']
- name: pandoc
type: group
steps:
- name: pandoc
type: brew
- name: pandoc
type: shell
platforms:
only: ['linux']
opts:
command: |
cd $(mktemp -d)
VERSION=$(curl -s "https://api.github.com/repos/jgm/pandoc/tags" | jq -r ".[] | select(.name | contains('cli')) | .name" | head -n 1)
curl -Lo pandoc.deb "https://github.com/jgm/pandoc/releases/download/$VERSION/pandoc-${VERSION}-1-amd64.deb"
dpkg -i pandoc.deb
rm -rf pandoc.deb
- name: jq
type: brew
- name: yq
@@ -187,6 +263,18 @@ install:
- name: ollama
type: brew
post_install: brew services start ollama
- name: openwebui
type: shell
check_installed: docker inspect open-webui
opts:
command: |
docker run -d \
-p 3300:8080 \
--add-host=host.docker.internal:host-gateway \
-v open-webui:/app/backend/data \
--name open-webui \
--restart always \
ghcr.io/open-webui/open-webui:main
- name: gi_gen
type: group
steps:
@@ -255,12 +343,20 @@ install:
command: |
cd $DOTFILES/utils
pnpm i && pnpm build && pnpm ginst
- name: tmux-config
type: shell
opts:
command: tmux source-file "$HOME/.config/tmux/conf.tmux" 2>/dev/null
- name: zplug
type: shell
check_installed: test -d ~/.zplug
check_has_update: exit 0
opts:
command: curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh
command: |
curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh
zplug install
zplug load --verbose
update_command: |
source $HOME/.dotfiles/zplug.init.zsh
zplug update
zplug load --verbose

View File

@@ -36,26 +36,28 @@ done
pushd $DOTFILES
if [[ ! -f "$DOTFILES/.device_uid" || -z $(cat "$DOTFILES/.device_uid") ]]; then
echo
echo_yellow "Unique device UID not set up. Enter device uid: "
read duid
echo
sofmani $DOTFILES/.config/sofmani.yml
if [[ -z $duid ]]; then
echo_red "Device UID cannot be empty. Exiting"
exit 1
fi
# if [[ ! -f "$DOTFILES/.device_uid" || -z $(cat "$DOTFILES/.device_uid") ]]; then
# echo
# echo_yellow "Unique device UID not set up. Enter device uid: "
# read duid
# echo
#
# if [[ -z $duid ]]; then
# echo_red "Device UID cannot be empty. Exiting"
# exit 1
# fi
#
# echo $duid >$DOTFILES/.device_uid
# echo_cyan "Device UID set to \"$duid\""
# fi
echo $duid >$DOTFILES/.device_uid
echo_cyan "Device UID set to \"$duid\""
fi
if is_mac; then
echo_yellow "Setting macOS defaults..."
write_default PMPrintingExpandedStateForPrint "-bool TRUE"
write_default NSScrollViewRubberbanding "-bool FALSE"
fi
# if is_mac; then
# echo_yellow "Setting macOS defaults..."
# write_default PMPrintingExpandedStateForPrint "-bool TRUE"
# write_default NSScrollViewRubberbanding "-bool FALSE"
# fi
echo_yellow "Setting up git..."
@@ -75,293 +77,293 @@ if [[ -z $(git config --global user.email) ]]; then
git config --global user.email "$email"
fi
if [[ $set_git_configs -eq 1 ]]; then
echo_cyan "Setting git global config..."
git config --global user.signingkey "~/.ssh/id_casraf.pub"
git config --global filter.lfs.clean "git-lfs clean -- %f"
git config --global filter.lfs.smudge "git-lfs smudge -- %f"
git config --global filter.lfs.process "git-lfs filter-process"
git config --global filter.lfs.required true
git config --global init.defaultBranch "master"
git config --global credential.helper "store"
git config --global pull.rebase true
git config --global core.excludesfile "~/.config/.gitignore"
# git config --global core.untrackedCache true
# git config --global core.fsmonitor true
git config --global rerere.enabled true
git config --global gpg.format "ssh"
git config --global gpg.ssh.allowedSignersFile "~/.ssh/allowed_signers"
git config --global commit.gpgsign true
git config --global maintenance.repo "~/.dotfiles"
git config --global fetch.writeCommitGraph true
git config --global log.showSignature true
git config --global core.excludesfile ~/.config/.gitignore
# if [[ $set_git_configs -eq 1 ]]; then
# echo_cyan "Setting git global config..."
# git config --global user.signingkey "~/.ssh/id_casraf.pub"
# git config --global filter.lfs.clean "git-lfs clean -- %f"
# git config --global filter.lfs.smudge "git-lfs smudge -- %f"
# git config --global filter.lfs.process "git-lfs filter-process"
# git config --global filter.lfs.required true
# git config --global init.defaultBranch "master"
# git config --global credential.helper "store"
# git config --global pull.rebase true
# git config --global core.excludesfile "~/.config/.gitignore"
# # git config --global core.untrackedCache true
# # git config --global core.fsmonitor true
# git config --global rerere.enabled true
# git config --global gpg.format "ssh"
# git config --global gpg.ssh.allowedSignersFile "~/.ssh/allowed_signers"
# git config --global commit.gpgsign true
# git config --global maintenance.repo "~/.dotfiles"
# git config --global fetch.writeCommitGraph true
# git config --global log.showSignature true
# git config --global core.excludesfile ~/.config/.gitignore
#
# # ================================================================================================
# # Aliases/Custom commands
# # ================================================================================================
#
# # Change status
# git config --global alias.unchanged "update-index --assume-unchanged"
# git config --global alias.changed "update-index --no-assume-unchanged"
# git config --global alias.show-unchanged "!git ls-files -v | sed -e 's/^[a-z] //p; d'"
# git config --global alias.list-aliases "!git config --global --list | grep --color alias\. | grep -v list-aliases | sed \"s/alias\./\$(tput setaf 1)/\" | sed \"s/=/\$(tput sgr0)=/\""
#
# # Open
# git config --global alias.open "!\$DOTFILES/plugins/git_custom_commands.plugin.zsh open"
# fi
# ================================================================================================
# Aliases/Custom commands
# ================================================================================================
# if [[ ! -f $(which delta) ]]; then
# if ask "Install delta?"; then
# echo_yellow "Installing delta..."
# # TODO get latest release
# platform_install git-delta \
# -l dpkg \
# -d "https://github.com/dandavison/delta/releases/download/0.17.0/git-delta_0.17.0_amd64.deb"
# fi
# fi
#
# if [[ ! -f $(which lazygit) ]]; then
# if ask "Install LazyGit?"; then
# if is_mac; then
# brew install lazygit
# else
# cd $(mktemp -d)
# lazygit_version=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -o '"tag_name": "v\K[^"]*')
# curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${lazygit_version}_Linux_x86_64.tar.gz"
# tar xf lazygit.tar.gz lazygit
# sudo install lazygit /usr/local/bin
# fi
# fi
# fi
# Change status
git config --global alias.unchanged "update-index --assume-unchanged"
git config --global alias.changed "update-index --no-assume-unchanged"
git config --global alias.show-unchanged "!git ls-files -v | sed -e 's/^[a-z] //p; d'"
git config --global alias.list-aliases "!git config --global --list | grep --color alias\. | grep -v list-aliases | sed \"s/alias\./\$(tput setaf 1)/\" | sed \"s/=/\$(tput sgr0)=/\""
# existing_pager=$(git config --global core.pager)
#
# if [[ -z $existing_pager ]]; then
# echo_yellow "Setting up delta as git pager..."
# git config --global core.pager delta
# git config --global interactive.diffFilter "delta --color-only"
# # git config --global delta.side-by-side true
# # git config --global delta.navigate true
# # git config --global delta.dark true
# git config --global merge.conflictStyle diff3
# git config --global delta.line-numbers true
# git config --global diff.colorMoved default
# fi
# Open
git config --global alias.open "!\$DOTFILES/plugins/git_custom_commands.plugin.zsh open"
fi
# echo_yellow "Installing binaries..."
if [[ ! -f $(which delta) ]]; then
if ask "Install delta?"; then
echo_yellow "Installing delta..."
# TODO get latest release
platform_install git-delta \
-l dpkg \
-d "https://github.com/dandavison/delta/releases/download/0.17.0/git-delta_0.17.0_amd64.deb"
fi
fi
# if [[ ! -f $(which fnm) ]]; then
# if ask "Install fnm?"; then
# echo_yellow "Installing fnm..."
# curl -fsSL https://fnm.vercel.app/install | bash
# fnm install --lts
# fnm use lts-latest
# fi
# fi
#
# which pyenv >/dev/null
# pyenv_inst=$([[ $(echo $?) == "0" ]] && echo 1 || echo 0)
# if [[ -d "$HOME/.pyenv" && $pyenv_inst == 0 ]]; then
# if ask "Install pyenv?"; then
# echo_yellow "Installing pyenv..."
# platform_install -b pyenv \
# -l cmd \
# -c 'curl https://pyenv.run | bash'
# fi
# fi
#
# if [[ ! -f $(which pipx) ]]; then
# if ask "Install pipx?"; then
# echo_yellow "Installing pipx..."
# platform_install -b pipx
# if is_linux; then
# sudo pipx ensurepath --global
# fi
# fi
# fi
if [[ ! -f $(which lazygit) ]]; then
if ask "Install LazyGit?"; then
if is_mac; then
brew install lazygit
else
cd $(mktemp -d)
lazygit_version=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -o '"tag_name": "v\K[^"]*')
curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${lazygit_version}_Linux_x86_64.tar.gz"
tar xf lazygit.tar.gz lazygit
sudo install lazygit /usr/local/bin
fi
fi
fi
# if [[ ! -f $(which pandoc) ]]; then
# if ask "Install pandoc?"; then
# echo_yellow "Installing pandoc..."
# pandoc_ver=$(get-gh-latest-tag -f '.name | contains("cli")' "jgm/pandoc")
# pandoc_ver=$(echo $pandoc_ver | sed 's/pandoc-cli-//')
# case $(uname -m) in
# x86_64)
# arch="amd64"
# ;;
# *)
# arch=$(uname -m)
# ;;
# esac
# dpkg_url="https://github.com/jgm/pandoc/releases/download/$pandoc_ver/pandoc-$pandoc_ver-1-$arch.deb"
# echo_cyan "Installing from $dpkg_url..."
# platform_install -b pandoc \
# -l dpkg \
# -d "$dpkg_url"
# fi
# fi
existing_pager=$(git config --global core.pager)
# if [[ ! -f $(which jq) ]]; then
# if ask "Install jq?"; then
# echo_yellow "Installing jq..."
# platform_install -b jq
# fi
# fi
#
# if [[ ! -f $(which yq) ]]; then
# if ask "Install yq?"; then
# echo_yellow "Installing yq..."
# pipx install yq
# fi
# fi
if [[ -z $existing_pager ]]; then
echo_yellow "Setting up delta as git pager..."
git config --global core.pager delta
git config --global interactive.diffFilter "delta --color-only"
# git config --global delta.side-by-side true
# git config --global delta.navigate true
# git config --global delta.dark true
git config --global merge.conflictStyle diff3
git config --global delta.line-numbers true
git config --global diff.colorMoved default
fi
# if [[ ! -f $(which direnv) ]]; then
# if ask "Install direnv?"; then
# echo_yellow "Installing direnv..."
# bin_path="/usr/local/bin" \
# platform_install direnv \
# -l cmd \
# -c 'export bin_path=/usr/local/bin curl -sfL https://direnv.net/install.sh | bash'
# fi
# fi
#
# if [[ ! -f $(which dotenvx) ]]; then
# if ask "Install dotenvx?"; then
# echo_yellow "Installing dotenvx..."
# platform_install \
# -b dotenvx/brew/dotenvx \
# -l cmd \
# -c 'curl -sfS https://dotenvx.sh | sh'
# fi
# fi
#
# launchctl setenv OLLAMA_HOST "0.0.0.0"
echo_yellow "Installing binaries..."
# if [[ -n "$OLLAMA_ENABLED" && ! -f $(which ollama) && ! -d "/Applications/Ollama.app" ]]; then
# if ask_no "Install ollama?"; then
# echo_yellow "Installing ollama..."
# mac_install='
# pushd $(mktemp -d)
# # pushd ~/Downloads
# curl -LO https://ollama.com/download/Ollama-darwin.zip
# unzip Ollama-darwin.zip
# mv Ollama.app /Applications/
# popd
# '
# inst="$(is_mac && echo "$mac_install" || echo 'curl -fsSL https://ollama.com/install.sh | sh')"
# platform_install \
# -m cmd -l cmd \
# -c "$inst"
# docker run -d \
# -p 3300:8080 \
# --add-host=host.docker.internal:host-gateway \
# -v open-webui:/app/backend/data \
# --name open-webui \
# --restart always \
# ghcr.io/open-webui/open-webui:main
# fi
# fi
if [[ ! -f $(which fnm) ]]; then
if ask "Install fnm?"; then
echo_yellow "Installing fnm..."
curl -fsSL https://fnm.vercel.app/install | bash
fnm install --lts
fnm use lts-latest
fi
fi
# echo_cyan "Checking personal tap..."
#
# if [[ ! -f $(which gi_gen) ]]; then
# if ask "Install gi_gen?"; then
# if is_linux; then
# gi_ver=$(get-gh-latest-tag "chenasraf/gi_gen")
# mkdir -p "$DOTBIN_META"
# arch=$(archmatch -mA "macos-arm" -mI "macos-intel" -l "linux-amd")
# fi
# platform_install --brew "chenasraf/tap/gi_gen" \
# -m brew \
# -l cmd \
# --cmd "curl -L https://github.com/chenasraf/gi_gen/releases/download/$gi_ver/gi_gen-$gi_ver-$arch -o $DOTBIN/gi_gen"
# fi
# fi
#
# if [[ ! -f $(which treelike) ]]; then
# if ask "Install tree-like?"; then
# echo_yellow "Installing treelike..."
# if is_linux; then
# treelike_ver=$(get-gh-latest-tag "chenasraf/treelike")
# mkdir -p "$DOTBIN_META"
# # arch=$(archmatch -mA "darwin-amd64" -mI "darwin-amd64" -l "linux-amd64")
# arch="linux-amd64"
# fi
# platform_install --brew "chenasraf/tap/treelike" \
# -m brew \
# -l cmd \
# --cmd "curl -L https://github.com/chenasraf/treelike/releases/download/$treelike_ver/treelike-$arch.tar.gz -o $DOTBIN/treelike.tar.gz"
# fi
# fi
#
# echo_yellow "Installing pnpm globals..."
#
# # pnpm packages
# # bin-lookup-name => npm-package-name
# declare -A check_npm=(
# "tsc" "typescript"
# "tldr" "tldr"
# "simple-scaffold" "simple-scaffold"
# "firebase" "firebase-tools"
# "prettier" "prettier"
# "http-server" "http-server"
# "licenseg" "licenseg"
# "vscode-json-language-server" "vscode-langservers-extracted"
# )
#
# install_npm_final=()
#
# for key value in ${(kv)check_npm}; do
# which $key >/dev/null 2>&1
# exit_code=$?
# if [[ $exit_code -ne 0 ]]; then
# install_npm_final+=("$value@latest")
# fi
# done
#
# if [[ $#install_npm_final -gt 0 ]]; then
# if ask "Install pnpm packages $install_npm_final?"; then
# echo_cyan "Installing pnpm packages ($install_npm_final)..."
# pnpm install -g $install_npm_final
# else
# echo_cyan "Skipping pnpm packages installation."
# fi
# # else
# # echo_cyan "All pnpm packages already installed."
# fi
which pyenv >/dev/null
pyenv_inst=$([[ $(echo $?) == "0" ]] && echo 1 || echo 0)
if [[ -d "$HOME/.pyenv" && $pyenv_inst == 0 ]]; then
if ask "Install pyenv?"; then
echo_yellow "Installing pyenv..."
platform_install -b pyenv \
-l cmd \
-c 'curl https://pyenv.run | bash'
fi
fi
if [[ ! -f $(which pipx) ]]; then
if ask "Install pipx?"; then
echo_yellow "Installing pipx..."
platform_install -b pipx
if is_linux; then
sudo pipx ensurepath --global
fi
fi
fi
if [[ ! -f $(which pandoc) ]]; then
if ask "Install pandoc?"; then
echo_yellow "Installing pandoc..."
pandoc_ver=$(get-gh-latest-tag -f '.name | contains("cli")' "jgm/pandoc")
pandoc_ver=$(echo $pandoc_ver | sed 's/pandoc-cli-//')
case $(uname -m) in
x86_64)
arch="amd64"
;;
*)
arch=$(uname -m)
;;
esac
dpkg_url="https://github.com/jgm/pandoc/releases/download/$pandoc_ver/pandoc-$pandoc_ver-1-$arch.deb"
echo_cyan "Installing from $dpkg_url..."
platform_install -b pandoc \
-l dpkg \
-d "$dpkg_url"
fi
fi
if [[ ! -f $(which jq) ]]; then
if ask "Install jq?"; then
echo_yellow "Installing jq..."
platform_install -b jq
fi
fi
if [[ ! -f $(which yq) ]]; then
if ask "Install yq?"; then
echo_yellow "Installing yq..."
pipx install yq
fi
fi
if [[ ! -f $(which direnv) ]]; then
if ask "Install direnv?"; then
echo_yellow "Installing direnv..."
bin_path="/usr/local/bin" \
platform_install direnv \
-l cmd \
-c 'export bin_path=/usr/local/bin curl -sfL https://direnv.net/install.sh | bash'
fi
fi
if [[ ! -f $(which dotenvx) ]]; then
if ask "Install dotenvx?"; then
echo_yellow "Installing dotenvx..."
platform_install \
-b dotenvx/brew/dotenvx \
-l cmd \
-c 'curl -sfS https://dotenvx.sh | sh'
fi
fi
launchctl setenv OLLAMA_HOST "0.0.0.0"
if [[ -n "$OLLAMA_ENABLED" && ! -f $(which ollama) && ! -d "/Applications/Ollama.app" ]]; then
if ask_no "Install ollama?"; then
echo_yellow "Installing ollama..."
mac_install='
pushd $(mktemp -d)
# pushd ~/Downloads
curl -LO https://ollama.com/download/Ollama-darwin.zip
unzip Ollama-darwin.zip
mv Ollama.app /Applications/
popd
'
inst="$(is_mac && echo "$mac_install" || echo 'curl -fsSL https://ollama.com/install.sh | sh')"
platform_install \
-m cmd -l cmd \
-c "$inst"
docker run -d \
-p 3300:8080 \
--add-host=host.docker.internal:host-gateway \
-v open-webui:/app/backend/data \
--name open-webui \
--restart always \
ghcr.io/open-webui/open-webui:main
fi
fi
echo_cyan "Checking personal tap..."
if [[ ! -f $(which gi_gen) ]]; then
if ask "Install gi_gen?"; then
if is_linux; then
gi_ver=$(get-gh-latest-tag "chenasraf/gi_gen")
mkdir -p "$DOTBIN_META"
arch=$(archmatch -mA "macos-arm" -mI "macos-intel" -l "linux-amd")
fi
platform_install --brew "chenasraf/tap/gi_gen" \
-m brew \
-l cmd \
--cmd "curl -L https://github.com/chenasraf/gi_gen/releases/download/$gi_ver/gi_gen-$gi_ver-$arch -o $DOTBIN/gi_gen"
fi
fi
if [[ ! -f $(which treelike) ]]; then
if ask "Install tree-like?"; then
echo_yellow "Installing treelike..."
if is_linux; then
treelike_ver=$(get-gh-latest-tag "chenasraf/treelike")
mkdir -p "$DOTBIN_META"
# arch=$(archmatch -mA "darwin-amd64" -mI "darwin-amd64" -l "linux-amd64")
arch="linux-amd64"
fi
platform_install --brew "chenasraf/tap/treelike" \
-m brew \
-l cmd \
--cmd "curl -L https://github.com/chenasraf/treelike/releases/download/$treelike_ver/treelike-$arch.tar.gz -o $DOTBIN/treelike.tar.gz"
fi
fi
echo_yellow "Installing pnpm globals..."
# pnpm packages
# bin-lookup-name => npm-package-name
declare -A check_npm=(
"tsc" "typescript"
"tldr" "tldr"
"simple-scaffold" "simple-scaffold"
"firebase" "firebase-tools"
"prettier" "prettier"
"http-server" "http-server"
"licenseg" "licenseg"
"vscode-json-language-server" "vscode-langservers-extracted"
)
install_npm_final=()
for key value in ${(kv)check_npm}; do
which $key >/dev/null 2>&1
exit_code=$?
if [[ $exit_code -ne 0 ]]; then
install_npm_final+=("$value@latest")
fi
done
if [[ $#install_npm_final -gt 0 ]]; then
if ask "Install pnpm packages $install_npm_final?"; then
echo_cyan "Installing pnpm packages ($install_npm_final)..."
pnpm install -g $install_npm_final
else
echo_cyan "Skipping pnpm packages installation."
fi
# else
# echo_cyan "All pnpm packages already installed."
fi
if [[ ! -f $(which tx) ]]; then
echo_yellow "Installing home utils..."
pushd $DOTFILES/utils
pnpm install && pnpm build && pnpm ginst
popd
fi
# if [[ ! -f $(which tx) ]]; then
# echo_yellow "Installing home utils..."
# pushd $DOTFILES/utils
# pnpm install && pnpm build && pnpm ginst
# popd
# fi
# Zplug Install
if [[ ! -d $HOME/.zplug ]]; then
if ask "Install zplug?"; then
curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh
fi
fi
# .config
echo_yellow "Copying config files..."
echo_cyan "Copying .config/nvim"
xrg "--delete $DOTFILES/.config/nvim/ $HOME/.config/nvim/" "$rsync_template"
echo_cyan "Copying LazyGit config"
xrg "$DOTFILES/.config/lazygit.yml $LAZYGIT_HOME/config.yml" "$rsync_template"
echo_cyan "Copying rest of .config"
xrg "--exclude 'nvim' --exclude 'lazygit.yml' $DOTFILES/.config/ $HOME/.config/" "$rsync_template"
# if [[ ! -d $HOME/.zplug ]]; then
# if ask "Install zplug?"; then
# curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh
# fi
# fi
#
# # .config
# echo_yellow "Copying config files..."
#
# echo_cyan "Copying .config/nvim"
# xrg "--delete $DOTFILES/.config/nvim/ $HOME/.config/nvim/" "$rsync_template"
#
# echo_cyan "Copying LazyGit config"
# xrg "$DOTFILES/.config/lazygit.yml $LAZYGIT_HOME/config.yml" "$rsync_template"
#
# echo_cyan "Copying rest of .config"
# xrg "--exclude 'nvim' --exclude 'lazygit.yml' $DOTFILES/.config/ $HOME/.config/" "$rsync_template"
# Tmux
if [[ $refresh_tmux -eq 1 ]]; then
echo_yellow "Reloading tmux config..."
tmux source-file "$HOME/.config/tmux/conf.tmux" 2>/dev/null
fi
# if [[ $refresh_tmux -eq 1 ]]; then
# echo_yellow "Reloading tmux config..."
# tmux source-file "$HOME/.config/tmux/conf.tmux" 2>/dev/null
# fi
if [[ -z "$OPENAI_API_KEY" ]]; then