# Dotfiler

A tiny app for managing config files.

The strategy here is that you can gather all of your configuration
files into a single directory and then symlink them into all the
places they need to be. This tool handles the symlinking. 

The advantage of this method is that we can more easily version-control
our config files and keep them consistent from machine to machine.

## Usage

There's little to no documentation set up for this tool. Have fun.
For an extended example, check out
[how I use it]https://nest.pijul.com/vlmutolo/dotfiles.

Let's say you want to configure your bashrc from another folder.
Let's call that other folder `$HOME/dotfiles`, and let's say the
`.bashrc` typically lives in `$HOME/.bashrc`.

Move your `$HOME/.bashrc` file to `$HOME/dotfiles/bashrc`. Create
a file called `install.toml` with the following contents.

```toml
[[link]]
file = "./bashrc"
link = "{{HOME}}/.bashrc"
```

Run the following command.
```bash
dotfiler -r $HOME/dotfiles
```

`dotfiler` will recursively search through that directory looking
for `install.toml` files. When it finds one, it will create the
specified link. Paths are relative to the `install.toml` files that
contain them.

There are several convenient template variables available:

- `HOME`
- `CACHE`
- `CONFIG`
- `DATA`
- `DATA_LOCAL`

It's not hard to add more. I just haven't had a use case yet for
anything other than `HOME` and `CONFIG`. These directories should
work on Windows, macOS, and Linux. This functionality is currently
provided by the [`directories-next`]https://github.com/xdg-rs/dirs
library.