Machine Tags & Variables

Customize sync behavior per machine with tags and variables

Machine Identity

Each machine gets a unique ID auto-generated from its hostname, platform, architecture, and MAC address. This ID is used to track which machine pushed a snapshot and to target pulls.

Tags

Tags are labels you attach to a machine. They are used in template conditionals to customize config files per machine.

Terminal

# Add tags

configsync machine tag add work

configsync machine tag add server

# Remove a tag

configsync machine tag remove server

# List tags

configsync machine tag list

Use tags in templates with the contains operator:

~/.zshrc (template)

{{#if tags contains "work"}}

source ~/.work-env

{{/if}}

Variables

Machine variables are key-value pairs available in templates as {{vars.key}}.

Terminal

# Set a variable

configsync machine var set git_email "sean@example.com"

# Get a variable

configsync machine var get git_email

# List all variables

configsync machine var list

~/.gitconfig (template)

[user]

email = {{vars.git_email}}

Variable Priority

When a profile is active and defines the same variable key, the profile variable takes priority over the machine variable. This lets you set machine-level defaults and override them per context.

~
Use machine vars for things that are always the same on a given machine (like paths), and profile vars for things that change by context (like git email).