Skip to main content

config_root

Function config_root 

Source
pub fn config_root(bin: &'static str) -> Result<PathBuf>
Available on crate feature config only.
Expand description

Returns the path to the user’s config directory for the given binary.

This is determined by the following steps:

  • If the environment variable <BIN>_CONFIG_DIR is set, return that.
  • If the operating environment provides a config directory, return $CONFIG_DIR/<bin>.
  • Otherwise, return an error.

The default directories are as follows:

PlatformValueExample
Linux$XDG_CONFIG_HOME or $HOME/.config/iroh/home/alice/.config/iroh
macOS$HOME/Library/Application Support/iroh/Users/Alice/Library/Application Support/iroh
Windows{FOLDERID_RoamingAppData}/irohC:\Users\Alice\AppData\Roaming\iroh