pub fn config_home() -> Option<PathBuf>Expand description
The XDG config base directory for lattice’s config root.
Resolves the XDG Base Directory config home so lattice’s config lives
under ~/.config/lattice/ on every Unix — macOS included — instead of
the platform-native ~/Library/Application Support that dirs::config_dir
returns there. This matches the convention every developer CLI / editor
uses (Helix, Neovim, Zed’s CLI, alacritty, starship, …): on macOS they read
~/.config/<app>, not ~/Library/Application Support/<app>.
Precedence (per the XDG Base Directory spec):
$XDG_CONFIG_HOMEwhen set to an absolute path — honoured on every platform so an explicit override always wins (a set-but-relative or empty value is spec-invalid and ignored).~/.configon Unix (via$HOME).dirs::config_dir()elsewhere (Windows →%APPDATA%).
None only when neither the override nor the home directory resolves.