Awesome
<div align="center"> <img src="https://raw.githubusercontent.com/shunk031/dotfiles/master/.github/header.png" alt="shunk031's"> <h1>π dotfiles</h1> <div> <a href="https://github.com/shunk031/dotfiles/actions/workflows/remote.yaml"> <img src="https://github.com/shunk031/dotfiles/actions/workflows/remote.yaml/badge.svg" alt="Snippet install"> </a> <a href="https://github.com/shunk031/dotfiles/actions/workflows/test.yaml"> <img src="https://github.com/shunk031/dotfiles/actions/workflows/test.yaml/badge.svg"> </a> <a href="https://codecov.io/gh/shunk031/dotfiles" > <img src="https://codecov.io/gh/shunk031/dotfiles/branch/master/graph/badge.svg?token=4VUJWKGAR7"/> </a> </div> <div> <a href="http://spacemacs.org/"> <img src="https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg" alt="spacemacs"> </a> <a href="https://github.com/zsh-users/zsh"> <img src="https://img.shields.io/badge/built%20with-zsh-black.svg" alt="zsh"> </a> <a href="https://github.com/sorin-ionescu/prezto"> <img src="https://img.shields.io/badge/built%20with-prezto-orange.svg" alt="prezto"> </a> <a href="https://github.com/tmux/tmux"> <img src="https://img.shields.io/badge/built%20with-tmux-green.svg" alt="tmux"> </a> </div> </div>πΏ Overview
This dotfiles repository is managed with chezmoiπ
, a great dotfiles manager.
The setup scripts are aimed for MacOS, Ubuntu Desktop, and Ubuntu Server. The first two (MacOS/Ubuntu Desktop) include settings for client
machines and the latter one (Ubuntu Server) for server
machines.
The actual dotfiles exist under the home
directory specified in the .chezmoiroot
.
See .chezmoiroot - chezmoi more detail on the setting.
π₯ Setup
To set up the dotfiles run the appropriate snippet in the terminal.
π» MacOS
- Configuration snippet of the Apple Silicon MacOS environment for client macnine:
bash -c "$(curl -fsLS http://shunk031.me/dotfiles/setup.sh)"
π₯οΈ Ubuntu
- Configuration snippet of the Ubuntu environment for both client and server machine:
bash -c "$(wget -qO - http://shunk031.me/dotfiles/setup.sh)"
Minimal setup
The following is a minimal setup command to install chezmoi and my dotfiles from the github repository on a new empty machine:
sh -c "$(curl -fsLS get.chezmoi.io)" -- init shunk031 --apply
βοΈ Install & Setup Application Individually
This repository provides for the installation and setup of each application individually. The desired application can be installed as follows (e.g., docker installation on MacOS):
bash install/macos/common/docker.sh
Each installation script can be found under the ./install
directory.
π οΈ Update & Test π§ͺ
Updating and testing the dotfiles follows chezmoi's daily operations. To verify that the updated scripts work correctly, run the scripts on the actual local machine and on the docker container.
π‘ Develop the Setup Scripts
The setup scripts are stored as shellscripts in an appropriate location under the ./install
directory.
After verifying that the shellscript works, store the chezmoi template-based file, which is based on the shellscript, in an appropriate location under the ./home/.chezmoiscripts
directory.
Below is the correspondence between shellscript and template for docker installation on MacOS.
- The shellscript for docker:
install/macos/common/docker.sh
- The chezmoi template for docker:
home/.chezmoiscripts/macos/run_once_10-install-docker.sh.tmpl
πΎ Test on the Local Machine
Currently, chezmoi does not automatically reflect updated configuration files (ref. twpayne/chezmoi#2738).
The following command will execute the chezmoi apply
command as soon as the file is modified using watchexec
.
make watch
The chezmoi documentation mentions automatica application by watchman
.
See https://www.chezmoi.io/user-guide/advanced/use-chezmoi-with-watchman/ for more detail.
π³ Test on Docker Container
Test the executation of the setup scripts on Ubuntu in its initial state. The following command will launch the test environment using Docker π³.
make docker
# docker run -it -v "$(pwd):/home/$(whoami)/.local/share/chezmoi" dotfiles /bin/bash --login
# shunk031@5f93d270cb51:~$
Run the chezmoi init --apply
command to verify that the system is set up correctly.
shunk031@5f93d270cb51:~$ chezmoi init --apply
π¦ Unit Test with Bats
Test the shellscript for setup with Bash Automated Testing System (bats).
The scripts for the unit test can be found under ./tests
directory.
π¦ Continuously monitor code coverage with Codecov
The code coverage of the ./install
scripts are continuously monitored at app.codecov.io/gh/shunk031/dotfiles. The following Icicle graph represents the code coverage of the scripts:
π Measure the startup speed of the dotfiles
The startup speed of zsh on MacOS with this dotfile is continuously measured at shunk031.me/my-dotfiles-benchmarks using benchmark-action/github-action-benchmark.
π‘ Miscellaneous Tips
Minimum setup for server machine without chezmoi
- Download
.tmux.conf.d/system/server.conf
and deploy as~/.tmux.conf
wget -O ~/.tmux.conf https://raw.githubusercontent.com/shunk031/dotfiles/master/home/dot_tmux.conf.d/system/server.conf
- Download
.vimrc
and deploy to~/.vimrc
wget -O ~/.vimrc https://raw.githubusercontent.com/shunk031/dotfiles/master/home/dot_vimrc
π Acknowledgements
Inspiration and code was taken from many sources, including:
- twpayne/chezmoi from twpayne.
- alrra/dotfiles: macOS / Ubuntu dotfiles from @alrra.
- b4b4r07/dotfiles: A repository that gathered files starting with dot from @b4b4r07.
- da-edra/dotfiles: Arch Linux config from @da-edra.
π License
The code is available under the MIT license.