giuscri / dotfiles

Sync your MacBook using an S3 bucket

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dotfiles

Even when keeping your MacBook configuration minimal you still end up having some dotfiles and Homebrew formulas installed. With this couple of files you'll be able to make a snapshot of the configured directories to an S3 bucket.

Creating an S3 bucket1, copying the security credentials of an IAM user with RW access to S3 buckets and launching make should suffice for setting a schedule of 1 snapshot per day.

The code should be pretty straightforward and you should be able to change it based on your needs.

Commands

./sync.sh -w -f ./config.yaml # save from old Mac
./sync.sh -r -f ./config.yaml # dump on new Mac

Configuration file

s3_bucket_name: com.github.giuscri.dotfiles

paths: # explicit paths to sync
  - ~/.ssh
  - ~/.gnupg
  - ~/.vimrc
  - ~/.zshrc
  - ~/.zprofile

# `true` if apps installed using Homebrew (and their configs) must be synched
formulae: true

Footnotes

  1. A basic Terraform configuration expecting to use Terraform Cloud as the backend is provided in case you need one. You must export TF_CLOUD_ORGANIZATION for Terraform to work.

About

Sync your MacBook using an S3 bucket


Languages

Language:Shell 62.1%Language:Makefile 21.0%Language:HCL 16.9%