This repository contains scripts to bootstrap the zero.sh system setup and prepare all necessary configuration files, ensuring a smooth setup process on a new system.
- Overview
- Features
- Requirements
- Installation
- Usage
- Directory Structure
- Next Steps
- Contributing
- License
This repository allows you to:
- Capture system defaults and configuration files from an existing macOS system.
- Prepare these files for easy use with zero.sh on a new system.
- Bootstrap the zero.sh repository without running the setup, so that the new system can be configured in a seamless manner.
- Automatically generates:
Brewfile
with your Homebrew packages.defaults.yaml
containing your macOS system preferences for installed apps and core macOS settings.- Symlinked configuration files (e.g.,
.bashrc
,.zshrc
,.gitconfig
, etc.), including shell profiles like.bash_profile
or.zprofile
. - Scripts to run before and after the setup.
- Pulls the latest zero.sh repository.
- Prepares the system for an easy, repeatable installation on a new machine.
- macOS system with:
- Homebrew installed.
- Git installed.
-
Clone the repository:
git clone https://github.com/yourusername/yourrepo.git cd yourrepo
-
Make sure the main script is executable:
chmod +x zero_prep.sh
-
Run the
zero_prep.sh
script to prepare your system configuration:./zero_prep.sh --path ~/path/to/store/prepped/config --workspace my_workspace
--path
: The location where the configuration files and repository will be stored.--workspace
: Optional. You can specify a workspace to organize your config files (e.g.,home
,work
).
-
If you want to bootstrap the zero.sh repository for future setup, use the
--bootstrap
flag:./zero_prep.sh --path ~/path/to/store/prepped/config --bootstrap
Running the script with the --bootstrap
option will pull the latest version of the zero.sh repository and prepare it for use on a new system. Note: The script will not run the zero.sh setup on your current machine; it will only clone the repository for future use.
Once you are on your new system, run the following to apply the setup:
caffeinate -i ~/.dotfiles/zero/setup
This will prevent the machine from going to sleep while zero.sh runs.
The script generates the following structure:
~/path/to/store/prepped/config
├── Brewfile
├── defaults.yaml
├── run/
│ ├── before/
│ └── after/
├── symlinks/
│ ├── bash/
│ ├── zsh/
│ ├── fish/
│ └── git/
└── zero/ (cloned zero.sh repository)
- Brewfile: Lists all Homebrew packages for easy installation.
- defaults.yaml: Contains macOS system preferences for installed apps and system settings.
- symlinks/: Contains symlinked configuration files for each shell and other configurations (e.g., git).
- run/: Contains scripts that run before and after the setup.
- zero/: Contains the cloned zero.sh repository.
-
Review the generated files in the configured directory. Add any other folders you wish to symlink (e.g., additional dotfiles or application settings) or customize any of the
before
orafter
run scripts to tailor the setup process to your needs. -
Move the generated files to
~/.dotfiles
:mv ~/path/to/store/prepped/config ~/.dotfiles
-
Optionally, upload the
~/.dotfiles
directory to a Git repository for future use:cd ~/.dotfiles git init git remote add origin <your-repo-url> git add . git commit -m "Initial dotfiles commit" git push -u origin main
-
On a new machine:
- Clone the repository:
git clone https://github.com/<your-username>/<your-repo>.git ~/.dotfiles --recursive
- Run zero.sh setup with
caffeinate
:caffeinate -i ~/.dotfiles/zero/setup
- Clone the repository:
I welcome contributions! Please fork the repository and submit a pull request with your changes.
This project is licensed under the MIT License. See the LICENSE file for more details.