-
-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration Guide
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.
- 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!"defaults:
link:
relink: true # Replace incorrect symlinks
force: true # Remove existing files/directories
backup: true # Create backups before overwritingUse 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.
Use the create section to ensure directories exist:
create:
- ~/.config
- ~/.local/binThe link section manages symlinks between your dotfiles and their target locations:
link:
~/.config/nvim: ~/.mydotfiles/nvim
~/.zshrc: ~/.mydotfiles/zsh/zshrcClone git repositories with optional descriptions:
git:
~/.oh-my-zsh:
url: https://github.com/ohmyzsh/ohmyzsh.git
description: "Oh My Zsh"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"}'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!"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 |
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/binRun specific profile:
hidedot --profile workMade with ❤️ in Go. Keep your dotfiles organized!
Licensed under GPL-3.0