Skip to content

Latest commit

 

History

History
executable file
·
101 lines (78 loc) · 4.56 KB

README.md

File metadata and controls

executable file
·
101 lines (78 loc) · 4.56 KB

Setting up the environment

Exporting the environment variables

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.

Creating a GitHub Token

If you need to create the GitHub Token you can follow this link.

Create Strap.sh GitHub Token

If you don't have one already you should create the Strap.sh GitHub Token here and following the Authorize Strap on GitHub procedure.

Running the strap.sh script

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

Running the setup.sh script

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

In case it is necessary this operations are performed by independenly configured scripts which can be run as needed:

  • setup_git: Sets up git configuration files
  • setup_karabiner: Sets up Karabiner.app configuration files
  • setup_system_files: Sets up several system configuration files
  • setup_system_settings: Sets up several system settings
  • setup_terminal: Loads Terminal.app and iTerm2.app themes
  • setup_tmux: Sets up tmux
  • setup_vim: Sets up vim / SpaceVim
  • setup_zsh: Setus up zsh

Backup/Restore Mackup settings

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