HermitGrab Logo

HermitGrab

hermit.toml Configuration

A detailed reference for the `hermit.toml` file format.

Top-Level Keys

These keys are defined at the root of your `hermit.toml` file.

provides = [<tags>]

A list of tags that this configuration file provides. These tags can be used by other configurations in their `requires` list.

provides = ["fish", "fish-aliases"]

requires = [<conditions>]

A list of conditions that must be met for this configuration file to be processed. If any condition is not met, the entire file is skipped.

# Only applies on Unix-like systems where the 'work' profile tag is active
requires = ["+os_family=unix", "+work"]

Sections

Sections define the actions HermitGrab will take. Each section can have its own `requires` key for conditional execution.

[[file]]

Manages linking or copying files and directories.

[[file]]
source = "starship.toml"
target = "~/.config/starship.toml"
method = "Link"
fallback = "Backup"
requires = ["+starship"]

[[patch]]

Atomically modifies an existing file.

[[patch]]
type = "JsonMerge"
source = "vscode_settings.json"
target = "~/.vscode-server/data/Machine/settings.json"
requires = ["user=vscode"]

[[install]]

Installs tools or packages. Can be a script or use the built-in Universal Binary Installer (`ubi`).

# Using a custom source
[[install]]
name = "ripgrep"
source = "apt"
check_cmd = "command -v rg"

# Using the UBI
[[install]]
name = "fish"
source = "ubi"
check_cmd = "command -v fish"
requires = ["+arch=aarch64", "+os=linux"]

[install.variables]
exe = "fish"
url = "https://github.com/fish-shell/fish-shell/releases/download/4.0.2/fish-static-aarch64-4.0.2.tar.xz"

[sources]

Defines reusable, templated installer scripts. Uses Handlebars for templating based on variables from the `[[install]]` section.

[sources]
apt = """
#!/bin/bash
[ "$(find /var/lib/apt/lists -type f -mmin +720)" ] && sudo apt-get update
sudo apt-get install -y --no-install-recommends {{ name }}
"""
brew = "brew install {{ name }}"

[profiles]

Defines profiles, which are named collections of tags. Running HermitGrab with a profile activates all of its tags.

[profiles]
default = ["fish"]
work-rust = ["fish", "git", "rust", "starship"]