Compare commits

..

3 Commits

3 changed files with 33 additions and 18 deletions

View File

@@ -1,26 +1,42 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e
which git >/dev/null 2>&1 # Check if git is installed
if [ $? -ne 0 ]; then if ! command -v git >/dev/null 2>&1; then
echo "Git isn't installed." echo "Git isn't installed."
exit exit 1
fi fi
# Set environment, default to 'personal'
ENVIRONMENT="${1:-personal}"
echo "Bootstrapping dotfiles for environment: $ENVIRONMENT"
# Clone dotfiles # Clone dotfiles
git clone git@github.com:nikdoof/dotfiles.git $HOME/.dotfiles >/dev/null echo "Cloning main dotfiles repository..."
git clone git@github.com:nikdoof/dotfiles-private.git $HOME/.dotfiles-private >/dev/null git clone git@github.com:nikdoof/dotfiles.git "$HOME/.dotfiles" >/dev/null
# Stow the default public packages # Clone private dotfiles based on environment
case "$ENVIRONMENT" in
personal)
echo "Cloning personal dotfiles..."
git clone git@github.com:nikdoof/dotfiles-private.git "$HOME/.dotfiles-private" >/dev/null
;;
work)
echo "Cloning work dotfiles..."
git clone git@github.com:nikdoof/dotfiles-work.git "$HOME/.dotfiles-work" >/dev/null
;;
*)
echo "Unknown environment: $ENVIRONMENT"
echo "Valid options are: personal, work"
exit 1
;;
esac
# Add the default packages
for package in bin shell-common bash zsh ssh; do for package in bin shell-common bash zsh ssh; do
echo "Stowing ${package}" echo "Stowing public package: $package"
$HOME/.dotfiles/bin/bin/stowage --clobber install $package "$HOME/.dotfiles/bin/bin/stowage" --clobber install "$package"
done
# Stow the default private packages
for package in ssh; do
echo "Stowing ${package}"
$HOME/.dotfiles/bin/bin/stowage -r $HOME/.dotfiles-private --clobber install $package
done done
echo "" echo ""
echo "Done, either source ~/.bash_profile / ~/.zshrc or restart your shell." echo "Done! Please either source ~/.bash_profile / ~/.zshrc or restart your shell."

View File

@@ -1,4 +1,4 @@
# Updates Homebrew installation from the Brewfile # Updates Homebrew installation from the Brewfile
function update-brewfile() { function update-brewfile() {
brew bundle check --file ~/.config/Brewfile || brew bundle --cleanup -f --file ~/.config/Brewfile brew bundle check --file "$HOME/.config/Brewfile" || brew bundle --cleanup -f --file "$HOME/.config/Brewfile"
} }

View File

@@ -1,6 +1,5 @@
Include ~/.orbstack/ssh/config Include ~/.orbstack/ssh/config
Include config-private Include config-*
Include config-ghostty
User nikdoof User nikdoof
AddKeysToAgent yes AddKeysToAgent yes