Link

The [[link]] table defines a file or directory to be linked.

KeyTypeDefaultDescription
sourceStringRequiredPath to the source file or directory relative to the hermit.toml.
targetStringRequiredPath to the destination on the target system. Supports Handlebars and XDG variables.
linkStringsoftThe type of link to create. Possible values are soft, hard, copy.
requiresArray of Strings[]A list of tags that must be active for this link to be processed.
fallbackStringabortWhat to do if the target already exists. See below for possible values.

Fallback Operations

The fallback key determines the behavior when a file or directory already exists at the target location.

ValueDescription
abort(Default) Abort the apply command.
backupMove the existing file to a .bak file. If .bak already exists, create .bak.1, etc.
backupoverwriteMove the existing file to a .bak file, overwriting .bak if it already exists.
deleteDelete any existing file, but not directories.
deletedirDelete any existing file or directory. Use with caution.
ignoreDo nothing if the file or directory already exists.

Example

[[link]]
source = "fish/config.fish"
target = "~/.config/fish/config.fish"
fallback = "backupoverwrite"
requires = ["fish", "+os_family=unix"]