Skip to main content

Module config

Module config 

Source
Expand description

~/.config/sysknife/config.toml — optional user configuration file.

§Resolution order (highest priority wins)

  1. Environment variables (always win — set by the caller or systemd unit)
  2. Values in ~/.config/sysknife/config.toml
  3. Built-in defaults (defined in sysknife-brain and sysknife-core)

§Usage

Call LacsConfig::load once at startup, then call LacsConfig::apply_defaults_to_env to populate env vars for any key that the config file sets but that is not already present in the environment. After that, the rest of the codebase continues reading env vars as before — no callers need to change.

use sysknife_core::config::LacsConfig;

LacsConfig::load().apply_defaults_to_env();

§Example config.toml

[daemon]
socket   = "/run/sysknife/daemon.sock"   # written as a raw path, not a URI
database = "/var/lib/sysknife/daemon.sqlite"

[llm]
provider     = "ollama"              # "ollama" | "anthropic" | "openai" | "gemini" | ...
model        = "qwen3:8b"            # default — see sysknife-brain DEFAULT_OLLAMA_MODEL
ollama_url   = "http://localhost:11434"
max_turns    = 10
# Optional: override the auto-detected thinking mode for Ollama.
# Default: auto-detect from the model name (qwen3 / qwq / deepseek-r → true).
# Set to `false` on CPU-only hosts running thinking models — thinking
# traces exceed Ollama's internal request timeout on 4 vCPUs.
# ollama_think = false

Structs§

AuditForwardSection
[audit.forward] section. Each subsection enables one external sink.
AuditSection
[audit] section.
DaemonSection
[daemon] section.
LacsConfig
Top-level structure of ~/.config/sysknife/config.toml.
LlmSection
[llm] section.
PolicySection
[policy] section. Currently holds per-action risk-level overrides.
StoragePoolSection
[storage.pool] section.
StorageSection
[storage] section. Selects the audit-log backend.
SyslogForwardSection
[audit.forward.syslog] section.

Enums§

StorageBackend
Type-state projection of StorageSection with cross-field invariants enforced.

Functions§

config_path
Returns the path to ~/.config/sysknife/config.toml, respecting XDG_CONFIG_HOME if set.
prefs_path
Returns the path to ~/.config/sysknife/prefs.md, respecting XDG_CONFIG_HOME if set. Same directory as config.toml.