This is my personal fork and customization of the dotfiles-codespaces repo for use in development containers and GitHub Codespaces. It's based on the original work of @dcreager and adapted by @vladistan.
This repository includes a pre-configured Oh-My-Zsh setup with:
- Theme: half-life
- Plugins: git, gitfast, z, aliases, aws, azure, brew, git-auto-fetch, ssh, and fzf (if available)
- Custom Configuration: Located in
dotfiles/.zshrc.symlink - Custom Scripts: Store custom ZSH scripts in
dotfiles/zsh/with the.symlinkextension
The Oh-My-Zsh installation is copied from dotfiles/.oh-my-zsh to ~/.oh-my-zsh during the install process.
Dotfiles repositories enable developers to maintain consistent configurations across different machines they work on. These repositories contain configuration files for different tools, allowing
Dotfiles repositories are super handy for developers. They keep your setup consistent across different machines you are working on. These repos save a ton of time setting up new systems. Plus, you can keep track of changes with version control and easily share your setup with your coworkers and friends. Sharing your dotfiles allows for mutual learning, as others can discover your clever setups while you gain insights from the community's configurations.
Examples of configurable items:
- Shell settings (e.g., .zshrc)
- Editor settings (e.g., .vimrc)
- Git configurations (e.g., .gitconfig)
- Special tools (e.g., pv, fzf, etc.)
- Oh-my-zsh plugins and themes
- Timezones
- Shell aliases
Dotfiles are very useful for development containers and code spaces. These setups are different from your local system, thus they do not share the same configuration files. While containers and code spaces give you a consistent base, dotfiles let you add your personal touch to these shared environments. This is especially handy when you're working with code spaces from repositories you don't own.
- You configure your VSCode or GitHub with the dotfiles repository to use. Look at the links below for details:
- Every time a new development container or codespace environment is created, the dotfiles repository is automatically cloned into the container. Then the repository install script is run inside the container to set up everything.
This setup is useful if you have an existing dotfiles setup based on the dcreager dotfiles manager Such as one of the ones below:
For a new setups I recommend using more modern tool like chez-moi that has a DevContainer feature
Alternatively, for a simpler container-only setup, you can refer to the guide by Bea Stollnitz on Codespaces Terminal Setup.
Why not use your original dotfile repo? Dotfiles repos based on dcreager's manager use multiple repositories: a generic manager and custom dotfiles. The manager script is usually a clone of dcreager's repo, while the dotfiles repo contains personalized configurations.
DevContainers and CodeSpaces, however, allow using only a single repository for both the installation script and dotfiles. Additionally, different tools and cloud environments clone the repo in various locations, almost never into the home directory, which doesn't work with dcreager's manager.
This container-specific dotfiles repo addresses both issues by combining the management script and the dotfiles into a single monorepo and being flexible with the location it's cloned into.
This repository automatically installs and configures:
- Dotfiles: Custom shell and git configurations
- Oh-My-Zsh: ZSH framework with plugins and themes
- Shell Configuration: Sets ZSH as the default shell
- Configure your GitHub Codespaces or VSCode Dev Container settings to use this repository
- When a new container is created, the
install.shscript automatically runs and:- Backs up any existing
.zshrcfile to.zshrc.bak - Copies Oh-My-Zsh configuration from
dotfiles/.oh-my-zshto your home directory - Installs all
.symlinkfiles (see below) - Changes your default shell to ZSH
- Backs up any existing
To manually install in any environment, run:
./install.shFiles with the .symlink extension are automatically linked to your home directory by the install script. The .symlink suffix is removed when creating the symlink.
Location: All .symlink files are stored in the dotfiles/ directory and subdirectories.
Examples:
dotfiles/.zshrc.symlink→~/.zshrcdotfiles/.gitconfig.symlink→~/.gitconfigdotfiles/zsh/aliases.zsh.symlink→~/zsh/aliases.zsh
You can view all symlink files by running:
./manage/dotfiles.sh listIf you'd like to create your own dotfiles based on this repo:
- Fork this repository
- Modify files in the
dotfiles/folder according to your preferences - Edit
.symlinkfiles to customize configurations - Update
dotfiles/.oh-my-zshsettings if needed - Configure your environment to use your fork
Dotfile repositories are public, so don't put any API keys, passwords, or personal info in them. Use proper secret storage methods to handle these things. This way, your sensitive info stays safe and isn't exposed to unauthorized access. Always follow best practices for managing secrets and credentials to keep your data and systems secure.