- hord
- noun: hoard, treasure, an accumulation of valuable things hidden away
Hord is a tool for dotfile management/symlink using Dhall. The idea being to write dotfiles as Dhall configuration files, and then provide a definition for where their symlinks should point.
Can be installed with stack install
, which should give you the hord
command.
Hord, when invoked, should be given a target folder containing a hord.dhall
configuration file, as well as dotfiles. The hord.dhall
file should have
the following structure:
{ hord : List { src : Text, dest : Text } }
Hord will then build the src
file to a _build
directory depending
on the following rules:
- If the
src
file is not a.dhall
file, just copy the file (Raw
). - If the
src
file is adhall
file:- If
dest
is a.yaml
or.yml
file, compile to Dhall code to YAML, similar todhall-to-yaml
. - If
dest
is a.json
file, compile the Dhall code to JSON, similar todhall-to-json
. - Otherwise, compile the Dhall code to a
Text
value and write that to the build file, similar todhall text
.
- If
As an example:
{ hord =
[ { src = "example.dhall"
, dest = "/home/user/.config/example"
}
, { src = "example2.dhall"
, dest = "/home/user/.config/example2.yaml"
}
, { src = "example3.dhall"
, dest = "/home/user/.config/example3.json"
}
, { src = "example4.txt"
, dest = "/home/user/.config/example4.txt"
}
]
}
Values for src
should be paths relative to hord.dhall
, whereas dest
should
be the absolute path for where the symlink should end up.