Skip to main content

read_config

Function read_config 

Source
pub fn read_config() -> Result<Config, Error>
Expand description

Loads and merges configuration from system, user, and project-local paths.

Zoi uses a hierarchical configuration model with the following precedence:

  • System: (/etc/zoi/config.yaml) - Defines global machine policy.
  • User: (~/.zoi/pkgs/config.yaml) - Defines user preferences.
  • Project: (./.zoi/pkgs/config.yaml) - Local overrides for a specific project.

Policy Enforcement: If a field is marked as unoverridable in the system-level policy, Zoi will ignore any overrides found in user or project configs.