To properly configure the environment for the scripts you should set the following environment variables:
# Dotfiles location
export DOTFILES=$HOME/.dotfiles
# GitHub user ID details
export GIT_USER=<GitHub user>
export GIT_EMAIL=<GitHub user email>
# Homebrew variables including token for private assets
export HOMEBREW_GITHUB_API_TOKEN=$DOTFILES/osx
export HOMEBREW_BREWFILE=<Brewfile Location>
# Strap.sh from https://macos-strap.herokuapp.com/
# The variables to setup the hardening script for OSX
# export STRAP_GIT_NAME=
export STRAP_GIT_EMAIL=$GIT_EMAIL
export STRAP_GITHUB_USER=$GIT_USER
export STRAP_GITHUB_TOKEN=<Strap GitHub Token>
# export CUSTOM_HOMEBREW_TAP=
# export CUSTOM_BREW_COMMAND=
export STRAP_ISSUES_URL='https://github.com/MikeMcQuaid/strap/issues/new'
This environment might be added to .zshenv
or .bashrc
to automatically load the values with every session start.
If you need to create the GitHub Token you can follow this link.
If you don't have one already you should create the Strap.sh GitHub Token here and following the Authorize Strap on GitHub procedure.
To run the script directly from the dotfiles repository you can use the following command:
$ bash -c "$(curl -fsSL raw.github.com/alejakun/dotfiles/master/bin/strap.sh)"
If environment's setup is correct the script will perform the following actions:
- Basic developer setup and hardening of OSX
- Install of Homebrew and basic casks
- Clone user's GitHub dotfiles repository for user into
~/.dotfiles
- Run
Brewfile
as pointed by$HOMEBREW_BREWFILE
In case it is necessary you can independently run the setup script by getting into the .dotfiles
directory and running the following command:
$ bash ~/.dotfiles/script/setup
- Run
~/.dotfiles/script/setup
script, which will:- Try to install
zsh
- Try to install Homebrew (in case strap.sh did not ran)
- Install apps and fonts specified in
Brewfile
- Restore Mackup configuration
- Install and configure OhMyZsh, Powerlevel10k and Fonts:
- Setup
OSX
System Preferences
- Try to install
In case it is necessary this operations are performed by independenly configured scripts which can be run as needed:
setup_git
: Sets upgit
configuration filessetup_karabiner
: Sets upKarabiner.app
configuration filessetup_system_files
: Sets up several system configuration filessetup_system_settings
: Sets up several system settingssetup_terminal
: LoadsTerminal.app
andiTerm2.app
themessetup_tmux
: Sets uptmux
setup_vim
: Sets upvim
/SpaceVim
setup_zsh
: Setus upzsh
Before it is safe to restore Mackup settings it is necessary to sync Mackup directory from Dropbox. Since this requires Dropbox configuration and the hostname is still not setup it is recommended not to configure Dropbox's backup yet, but after the script is fully run.
To run a backup you can go to .dotfiles/bin
and execute: ./backup.sh backup
To restore a backup you can go to .dotfiles/bin
and execute: ./backup.sh restore