This is a tool for my own personal use for deploying my dotfiles
Config file is specified in yaml. If not specified it will look for it at <cwd>/dotloy.yaml
Preprocessing is done on all files that end with .in
. Variables other than the default
can be defined by setting the variables
in the config for that file.
The template syntax is similar to handlebars, that is {{ var }}
will expand
to whatever var
is set to. Namespaces are done with .
.
cwd
: Directory in which the config file residesconfig.
: Namespace for variables defined at the toplevel of the configtarget.
: Namespace for variables defined on each targetxdg.
: Namespace for xdg standard pathshome
: Home directoryconfig
: Top level config dir, same on linux aslocal.config
but on windows it uses/Roaming
rather than/Local
exec
: Local executable file directory. Note: Currently only available on Linuxlocal.
: Namespace for local xdg pathsconfig
: Config path, only differs on windows
Linking can be done by setting the to
variable on the path. Files are hard-linked by default
while directories are soft-linked. This can be changed by setting link_type
to soft
or hard
(hard
is invalid for directories).
Say I have a config file for my zsh and I want to break it up into different files, one for aliases, one for env variables, etc. I don't want to have to deploy all of these files to my zsh root so instead I source them from zshrc. In order to make this not dependent of the location of the dotfiles dir I use templates:
config file:
variables:
loaddir: "{{ cwd }}"
targets:
- from: zshrc.in
to: "{{ xdg.home }}/.zshrc"
zshrc.in:
source {{ config.loaddir }}/aliases
source {{ config.loaddir }}/env
Then we can just run dotloy deploy
in the directory and it will expand the
templates in zshrc.in
and then copy the result to whatever the home directory
is on the current os.