Configs (SubEntry)¶
A SubEntry (config entry) represents a single configuration that tidydots manages, by default through symlinks. Config entries live inside an Application's entries array and define where files are backed up in your dotfiles repo and where they should be deployed on the target system.
Schema Reference¶
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Entry identifier, unique within its application |
backup | string | yes | Path in the dotfiles repo where config files are stored |
targets | map[string]string | yes | OS-specific target paths where files are deployed |
files | []string | no | Specific files to manage. Empty = entire folder |
method | string | no | Deployment method: symlink (default) or copy. See Deployment Method |
sudo | bool | no | Use elevated privileges for deployment operations |
How It Works¶
When you run tidydots restore, for each config entry tidydots:
- Reads the
backuppath (relative to the config directory) - Looks up the
targetsmap for the current OS - Creates a symlink from the target path pointing to the backup path (or writes a real file copy, if
method: copyis set — see Deployment Method) - If
filesis specified, only those specific files are symlinked (or copied)
The result is that your system reads configuration from the target path, but the actual files live in your dotfiles repository.
Fields in Detail¶
backup¶
The backup field specifies where the configuration files are stored in your dotfiles repository. This path is relative to the directory containing tidydots.yaml.
Note
The backup field is what makes an entry a "config entry." If backup is present, tidydots treats the entry as a symlink-managed configuration.
targets¶
The targets field is a map from OS identifier to the target path on that OS. tidydots looks up the current OS and uses the corresponding path.
At least one target must be declared. A config entry with backup set but no targets will be rejected during validation.
Supported OS keys:
| Key | Platform |
|---|---|
linux | Linux (all distributions) |
windows | Windows |
Paths support ~ expansion to the user's home directory.
Path templating is also supported. Any path containing {{ }} delimiters is rendered as a Go template before expansion:
See Templates for available template variables and functions.
files¶
The files field is an optional list of specific filenames to manage. When specified, only those files are symlinked individually. When omitted or empty, the entire folder is symlinked.
Tip
Use files when you want to manage individual dotfiles from a backup directory that may contain other files you do not want symlinked. Leave files empty when you want the entire directory structure managed as a unit.
method¶
The method field selects how tidydots deploys this entry's files to the target path:
symlink(default, or whenmethodis omitted) — creates a symlink at the target pointing back into the dotfiles repo.copy— writes a real, independent file at the target instead. The repo file remains the source of truth.
See Deployment Method below for the full behavior, migration notes, and v1 limitations.
sudo¶
When sudo: true is set, tidydots uses elevated privileges for all symlink operations on this entry. This is required for targets outside your home directory, such as system configuration files.
Warning
Only set sudo: true when the target path genuinely requires elevated privileges (e.g., /etc/ paths). Using sudo unnecessarily may create files owned by root in unexpected locations.
Deployment Method¶
By default, config entries are deployed as symlinks: the target path becomes a symlink pointing back into your dotfiles repo, and the repo file is what you actually edit. Setting method: copy on an entry switches to writing a real, independent file at the target instead.
entries:
- name: "blacklist"
method: copy
files: ["blacklist-raydium.conf"]
backup: "./Linux/modprobe"
targets:
linux: "/etc/modprobe.d"
sudo: true
Symlink vs. Copy¶
| Method | Target becomes | How updates propagate |
|---|---|---|
symlink (default) | A symlink into the dotfiles repo | Immediate — the target always reflects the repo file |
copy | A real, independent file | Only on the next tidydots restore |
Refresh and Idempotency¶
With method: copy, every tidydots restore compares the target file's content against the corresponding repo (backup) file:
- If the contents differ, the target is overwritten with the current repo content.
- If the contents already match, tidydots makes no changes (a no-op).
Because the target is a real file rather than a live link, editing the file in the dotfiles repo and re-running tidydots restore is how changes reach a copy-mode target.
Warning
If the target already exists as a real file and its contents differ from the repo's, tidydots restore overwrites it with the repo content. Unlike symlink mode, copy mode does not merge the existing target's content into your backup first — whatever was at the target is lost. The --no-merge and --force flags that control this behavior for symlink entries do not apply to copy entries; copy mode always overwrites on drift, unconditionally. Back up any pre-existing target file yourself before pointing a new method: copy entry at it.
Migrating from Symlink to Copy¶
If the target currently exists as a symlink (for example, the entry was previously deployed with method: symlink, or adopted), switching the entry to method: copy and re-running tidydots restore removes the existing symlink and replaces it with a real file copied from the repo. This makes symlink-to-copy migration safe without any manual cleanup.
v1 Limitations¶
- Files only —
method: copyrequires an explicit, non-emptyfiles:list. Whole-folder copying (files: []) is not supported and is rejected during config validation. - No template rendering — Template (
.tmpl) rendering only ever applies to folder entries (an entry with an emptyfiles:list); see Template Files in Config Entries. Sincemethod: copyrequires an explicit, non-emptyfiles:list, template rendering never applies to copy entries — this is a consequence of copy mode being files-only, not an additional restriction.
When to Use It¶
Use method: copy for files that must be readable very early in boot, before $HOME (or an encrypted subvolume containing your dotfiles repo) is mounted — for example /etc/modprobe.d or /etc/udev/rules.d. At that point in boot, a symlink into the dotfiles repo would be a dangling link, since its target isn't available yet; a real copied file has no such dependency and is readable immediately.
Examples¶
Single File¶
Manage a single configuration file:
This creates a symlink ~/.gitconfig pointing to <dotfiles>/git/.gitconfig.
Entire Folder¶
Manage an entire configuration directory:
entries:
- name: "nvim-config"
backup: "./nvim"
targets:
linux: "~/.config/nvim"
windows: "~/AppData/Local/nvim"
This creates a symlink ~/.config/nvim pointing to <dotfiles>/nvim/.
Multiple Files from One Backup¶
Pick specific files from a backup directory:
entries:
- name: "zsh-dotfiles"
backup: "./zsh"
files:
- ".zshrc"
- ".zprofile"
- ".zshenv"
targets:
linux: "~"
This creates three individual symlinks (~/.zshrc, ~/.zprofile, ~/.zshenv), each pointing to the corresponding file in <dotfiles>/zsh/.
Cross-Platform Entry¶
Define different target paths per OS:
entries:
- name: "terminal-config"
backup: "./alacritty"
targets:
linux: "~/.config/alacritty"
windows: "~/AppData/Roaming/alacritty"
On Linux the symlink is at ~/.config/alacritty; on Windows it is at ~/AppData/Roaming/alacritty. Both point to the same <dotfiles>/alacritty/ backup directory.
Path Templates¶
Use template expressions in target paths for host-specific layouts:
On a machine with hostname desktop, this resolves to ~/.config/desktop/nvim. See Templates for the full set of available variables.
System-Level Config with Sudo¶
Manage files that require root privileges:
entries:
- name: "pacman-conf"
sudo: true
backup: "./system/pacman"
files:
- "pacman.conf"
targets:
linux: "/etc"
- name: "hosts"
sudo: true
backup: "./system"
files:
- "hosts"
targets:
linux: "/etc"
Multiple Entries in One Application¶
Group related configs under one application:
applications:
- name: "zsh"
description: "Z shell configuration"
when: '{{ ne .OS "windows" }}'
entries:
- name: "zsh-dotfiles"
backup: "./zsh"
files:
- ".zshrc"
- ".zprofile"
targets:
linux: "~"
- name: "zsh-custom"
backup: "./zsh/custom"
targets:
linux: "~/.config/zsh/custom"
package:
managers:
pacman: "zsh"
apt: "zsh"
brew: "zsh"
Template Files in Config Entries¶
Config entries can contain .tmpl template files in their backup directory. During restore, these files are rendered using the template engine, and the output is written as .tmpl.rendered sibling files. The symlink then points to the rendered output.
For example, if your backup directory contains alacritty.toml.tmpl:
- tidydots renders the template to
alacritty.toml.tmpl.rendered - A relative symlink
alacritty.tomlis created pointing toalacritty.toml.tmpl.rendered - The folder-level symlink from the target path points to the backup directory as usual
See Templates for the full template system documentation.