devbox/local-install.fish

67 lines
2.2 KiB
Fish
Raw Permalink Normal View History

2026-03-17 14:44:43 -07:00
# Install dotfiles (and optionally tools) to the current macOS host,
# for example when provisioning within a VM.
set -f DEFAULT_FULL_NAME 'Brent Schroeter'
2026-04-01 10:21:10 -07:00
argparse -S 'email=' 'full-name=' ghostty install-mise overwrite -- $argv
2026-03-17 14:44:43 -07:00
if not set -ql _flag_full_name
set -f _flag_full_name "$DEFAULT_FULL_NAME"
end
if not set -ql _flag_email
echo '--email is required for VCS configuration' >&2
return 1
end
mkdir -p ~/.config
if set -ql _flag_overwrite; or not test -e ~/.gitconfig
cp ./assets/git/gitconfig ~/.gitconfig
sed -i '' "s/{{ VCS_EMAIL }}/$_flag_email/" ~/.gitconfig
sed -i '' "s/{{ VCS_NAME }}/$_flag_full_name/" ~/.gitconfig
else
echo 'Git config already exists. Use --overwrite to replace it.' >&2
end
if set -ql _flag_overwrite; or not test -e ~/.config/jj/config.toml
mkdir -p ~/.config/jj
cp ./assets/jj/config.toml ~/.config/jj/
sed -i '' "s/{{ VCS_EMAIL }}/$_flag_email/" ~/.config/jj/config.toml
sed -i '' "s/{{ VCS_NAME }}/$_flag_full_name/" ~/.config/jj/config.toml
else
echo 'JJ config already exists. Use --overwrite to replace it.' >&2
end
if set -ql _flag_overwrite; or not test -e ~/.config/helix
if test -e ~/.config/helix
rm -r ~/.config/helix
end
cp -r ./assets/helix ~/.config/helix
else
echo 'Helix configs already exist. Use --overwrite to replace them.' >&2
end
if set -ql _flag_install_mise
brew install mise
if set -ql _flag_overwrite; or not test -e ~/.config/mise/config.toml
mkdir -p ~/.config/mise
cp ./assets/mise/config.toml ~/.config/mise/
else
echo 'Mise config already exists. Use --overwrite to replace it.' >&2
end
mise install
end
2026-04-01 10:21:10 -07:00
if set -ql _flag_ghostty
if [ "$(uname)" = Darwin ]
if set -ql _flag_overwrite; or not test -e ~/Library/Application\ Support/com.mitchellh.ghostty/config
mkdir -p ~/Library/Application\ Support/com.mitchellh.ghostty
cp ./assets/ghostty/config ~/Library/Application\ Support/com.mitchellh.ghostty/config
else
echo 'Ghostty config already exists. Use --overwrite to replace it.' >&2
end
else
echo 'Ghostty setup on Linux is not yet supported. Skipping.' >&2
end
end