Use dotrunner
and dotlinker
to build a fantastically aesthetic macOS dotfiles set up.
✅ Organize by topics (folder modules), i.e. 'nodejs', 'osx', and 'python'.
✅ DAG (Directed Acyclic Graph) based runner for a powerful dependency system.
✅ No shell scripts, gunk, yuck, and hairballs required
Here's an example dotfiles repo:
~/.dotfiles
asdf/
brew/
install.yml
Brewfile
python/
osx/
nodejs/
.npmrc.symlink
install.yml
fonts/
And here's an example install.yml
taken from the nodejs
module:
script: npm i -g yarn
deps:
- asdf
Note: check out the example if you'd like to test this all out on a Docker container instance.
Install:
$ pip install dotrunner dotlinker
Dry run:
$ dotrunner ~/.dotfiles --dry-run
And finally, apply (this will obviously change your system!):
$ dotrunner ~/.dotfiles
This layout describes a system that installs apps (with homebrew
), development tools (with asdf
), nodejs tools (with install.sh
) and some system defaults (with set-defaults.sh
):
asdf/ <----- a 'module'
install.yml <----- a module install file. required.
Asdffile
brew/
install.yml
Brewfile
nodejs/
.npmrc.symlink <--- this is handled by dotlinker, see
https://github.com/jondot/dotlinker
install.yml
install.sh
osx/
install.yml
set-defaults.sh
This system follows a few simple principles:
- Every directory is a module if it has an
install.yml
file and it doesn't start with a dash (-). - Each module can describe
deps
(dependencies) and ascript
to run. - Each module actions must be idempotent: running the same script multiple times will have the same result. In other words
dotrunner
will happily run your scripts again on reruns/failures and you're responsible to do validation/checks in your scripts.
Here are a few examples of an install.yml
file:
No dependencies:
script: sh ./install.sh
Has depdendencies but no script
, it will use ./install
script by default.
deps:
- brew
- osx
Has both dependencies and a script
which points to an executable script:
script: ./install.sh
deps:
- brew
- osx
Fork, implement, add tests, pull request, get my everlasting thanks and a respectable place here :).
To all Contributors - you make this happen, thanks!
Copyright (c) 2018 Dotan Nahum @jondot. See LICENSE for further details.