Skip to content

Configuration Guide

Youri Theodora Kopoulos Kirchner Mattar edited this page Jan 13, 2026 · 3 revisions

hideDot uses a YAML configuration file (default: hidedot.conf.yaml) to manage your dotfiles setup. The configuration file supports multiple sections that can be executed in sequence.

Full Configuration Example

- defaults:
    link:
      relink: true   # Replace incorrect symlinks
      force: true    # Remove existing files/directories
      backup: true   # Enable automatic backups
  
  profile: personal  # Optional: profile name for filtering
  
  create:
    - ~/.config
    - ~/.local/bin
  
  link:
    ~/.config/nvim: ~/.mydotfiles/nvim
    ~/.zshrc: ~/.mydotfiles/zsh/zshrc
  
  git:
    ~/.oh-my-zsh:
      url: https://github.com/ohmyzsh/ohmyzsh.git
      description: "Oh My Zsh"
  
  shell:
    - [touch ~/.hushlogin, "Create hushlogin"]
    - command: "cat > ~/.config/myapp/config.json"
      description: "Create config file"
      stdin: '{"key": "value"}'
  
  hooks:
    pre_link:
      - echo "Starting link process..."
    post_link:
      - echo "Links created successfully!"

Configuration Sections

Defaults Section

defaults:
  link:
    relink: true   # Replace incorrect symlinks
    force: true    # Remove existing files/directories
    backup: true   # Create backups before overwriting

Profile Section

Use profiles to organize configs for different machines or environments:

profile: personal  # or "work", "server", etc.

Run with --profile personal to only apply configs with matching profile.

Create Section

Use the create section to ensure directories exist:

create:
  - ~/.config
  - ~/.local/bin

Link Section

The link section manages symlinks between your dotfiles and their target locations:

link:
  ~/.config/nvim: ~/.mydotfiles/nvim
  ~/.zshrc: ~/.mydotfiles/zsh/zshrc

Git Section

Clone git repositories with optional descriptions:

git:
  ~/.oh-my-zsh:
    url: https://github.com/ohmyzsh/ohmyzsh.git
    description: "Oh My Zsh"

Shell Section

Execute shell commands with descriptions. Two formats are supported:

Array format (simple):

shell:
  - [touch ~/.hushlogin, "Create hushlogin"]
  - [fc-cache -fv, "Rebuild font cache"]

Map format (with stdin support):

shell:
  - command: "cat > ~/.config/myapp/config.json"
    description: "Create config file"
    stdin: '{"key": "value"}'

Hooks Section

Run custom commands at specific points in the process:

hooks:
  pre_link:
    - echo "Starting link process..."
  post_link:
    - echo "Links created successfully!"
  pre_shell:
    - echo "About to run shell commands..."
  post_shell:
    - echo "Shell commands completed!"

Using Templates

Templates use Go's text/template syntax with these variables:

- link:
    ~/.config/git/config-{{ .Hostname }}: ./git/config
  
  shell:
    - ["echo 'Running on {{ .OS }}/{{ .Arch }}'", "Show system info"]

Available template variables:

Variable Description Example
{{ .Hostname }} Machine hostname macbook-pro
{{ .Username }} Current user john
{{ .HomeDir }} Home directory path /Users/john
{{ .OS }} Operating system darwin, linux, windows
{{ .Arch }} Architecture amd64, arm64
{{ .Date }} Current date 2024-01-15

Multiple Profiles

You can have multiple profile configurations in the same file:

# Personal machine config
- profile: personal
  link:
    ~/.gitconfig: ~/.mydotfiles/git/gitconfig-personal
    ~/.zshrc: ~/.mydotfiles/zsh/zshrc

# Work machine config
- profile: work
  link:
    ~/.gitconfig: ~/.mydotfiles/git/gitconfig-work
    ~/.zshrc: ~/.mydotfiles/zsh/zshrc-work

# Common config (no profile = always applied)
- create:
    - ~/.config
    - ~/.local/bin

Run specific profile:

hidedot --profile work

Clone this wiki locally