dotfiles/init.sh

69 lines
2.3 KiB
Bash
Raw Normal View History

2024-05-05 00:01:20 +00:00
#!/usr/bin/env bash
set -ex
2024-05-05 07:05:46 +00:00
# This file and this entire repo began modeled after https://github.com/onlyhavecans/dotfiles
2024-05-05 00:01:20 +00:00
# Do a curlbash to allow me to take over your system
2024-05-05 06:57:14 +00:00
# curl -sL https://stash.firekitten.net/kittyfangs/dotfiles/raw/branch/main/init.sh | bash
2024-05-05 00:01:20 +00:00
## Make sure we have git
for app in git curl; do
if ! command -v "$app" &>/dev/null; then
echo "Please install $app first"
exit 1
fi
done
## Install homeshick
if [[ ! -d $HOME/.homesick ]]; then
git clone https://github.com/andsens/homeshick.git "$HOME/.homesick/repos/homeshick"
# shellcheck source=/dev/null
source "$HOME/.homesick/repos/homeshick/homeshick.sh"
source $HOME/.homesick/repos/homeshick/completions/homeshick-completion.bash
## clone home, then set it to ssh afterwards
## This means we need our keys before we can make further actions - disable the ssh behavior for now
homeshick --batch clone https://stash.firekitten.net/kittyfangs/dotfiles.git
## git -C "$HOME/.homesick/repos/dotfiles" remote set-url origin git@stash.firekitten.net:kittyfangs/dotfiles
2024-05-05 00:01:20 +00:00
## Lets get the powerhsell version since we are initing in bash
homeshick --batch clone https://github.com/KitKat31337/homepsick.git
2024-05-05 00:01:20 +00:00
## Link everything
homeshick link --force
else
## Update the repos
if ! command -v homeshick &>/dev/null; then
source "$HOME/.homesick/repos/homeshick/homeshick.sh"
source $HOME/.homesick/repos/homeshick/completions/homeshick-completion.bash
fi
homeshick pull
homeshick link
fi
2024-05-05 06:44:20 +00:00
2024-05-20 05:05:02 +00:00
if ! command -v brew &>/dev/null; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
[ -d /usr/local/bin ] && PATH="/usr/local/bin:$PATH"
[ -d /opt/homebrew/bin ] && PATH="/opt/homebrew/bin:$PATH"
[ -d /home/linuxbrew/.linuxbrew/bin ] && PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
eval $(brew shellenv)
brew bundle install --file=~/.config/Brewfile
fi
## All my asdf
# if [[ ! -d $HOME/.asdf ]]; then
# git clone https://github.com/asdf-vm/asdf.git ~/.asdf
# git -C ~/.asdf checkout "$(git -C ~/.asdf describe --abbrev=0 --tags)"
2024-05-20 05:05:02 +00:00
# # shellcheck source=/dev/null
# source "$HOME/.asdf/asdf.sh"
2024-05-20 05:05:02 +00:00
# asdf plugin-add python
# asdf install python latest
# asdf global python latest
# fi
2024-05-20 05:05:02 +00:00
2024-05-05 06:44:20 +00:00
# Init Starship
eval "$(starship init bash)"