pub struct LacsConfig {
pub daemon: Option<DaemonSection>,
pub llm: Option<LlmSection>,
pub policy: Option<PolicySection>,
pub audit: Option<AuditSection>,
pub storage: Option<StorageSection>,
}Expand description
Top-level structure of ~/.config/sysknife/config.toml.
All fields are optional — absent sections use built-in defaults.
Fields§
§daemon: Option<DaemonSection>§llm: Option<LlmSection>§policy: Option<PolicySection>§audit: Option<AuditSection>§storage: Option<StorageSection>Implementations§
Source§impl LacsConfig
impl LacsConfig
Sourcepub fn config_path() -> PathBuf
pub fn config_path() -> PathBuf
Returns the path to the config file (~/.config/sysknife/config.toml).
Sourcepub fn load() -> Self
pub fn load() -> Self
Load ~/.config/sysknife/config.toml.
Returns LacsConfig::default() (all None) if the file is absent —
this is the normal, unconfigured happy path and is unchanged.
If the file IS present but cannot be parsed as TOML, or exists but
cannot be read (e.g. permission denied), this is treated as a fatal
misconfiguration rather than silently falling back to defaults: a clear
message is printed to stderr and the process exits with status 1.
Silently defaulting in that case would drop [storage] / [policy]
overrides (backend selection, risk-level overrides) without any
indication to the operator — a silent security downgrade. See
try_load for the non-exiting core used by tests.
Sourcepub fn apply_defaults_to_env(&self)
pub fn apply_defaults_to_env(&self)
Set environment variables from the config file for any key that is NOT already present in the process environment.
§Safety note
This must be called during single-threaded startup, before the async
runtime or any thread pool is initialised. Modifying env vars while
other threads are reading them is undefined behaviour. Both main.rs
(daemon) and the Tauri setup hook (shell) satisfy this contract.