Skip to content

✨ darkone.service.openclaw

OpenClaw assistant of an AI space (gateway + control UI, behind the zone SSO).

One instance per ai-space host, declared like any service:

- hostname: "ia-pro"
profile: "ai-space"
users: ["alice"] # members: Kanidm group `space-ia-pro`
features: ["monitoring-node"] # alerts: space down, gateway unit failed
services: { openclaw: {} }
  • access: Caddy forward auth, members of space-<host> only (proxy.spaceMembersOnly); OpenClaw trusts the zone gateway as proxy (trusted-proxy) and reads the identity from x-auth-request-email;
  • tailnet: a member’s personal device passes without the SSO (proxy.tailnetIdentity), the only way in for the Android app;
  • devices: a member’s browser is paired on first visit, without operator admin (granted from the host CLI only); the app with openclaw qr;
  • port: reachable from the zone gateway only;
  • host CLI: openclaw (alone: the TUI), re-run as the service user, past trusted-proxy with the gateway password (openclaw-gateway-password, just space-init); admins and cliUsers (default: the owner) only;
  • state: /var/lib/openclaw (provider logins, sessions, workspace, Matrix E2EE keys);
  • owner (owner, default: the only member): its subscription runs the agent, it gets approval requests and proactive messages;
  • Matrix: DM channel with the bot @<host>:<domain>, members only, rooms ignored, one session per member when several, when the network has Matrix and just space-init <host> created the bot (marker var/generated/spaces/<host>.nix, token in the space’s sops file); exec approvals asked to the owner in DM;
  • agent tooling: MCP, skills, Claude Code / Codex / OpenCode and packages of the space (darkone.host.ai-space), shared with the members’ homes;
  • identity (identity: name, emoji, avatar): imposed, also on the Matrix bot (display name; avatar, else the emoji drawn), the avatar uploaded by just space-init <host> (eval warning when out of date);
  • mutableConfig: config writable from the UI and the CLI, Nix keys merged at each start (imposed: access, channels, plugins, identity, store paths; seeded once: model, exec, talk…), owner gets operator.admin;
  • workspace (/var/lib/openclaw/workspace): workspace files (AGENTS.md, SOUL.md…) replaced at each start, others left to the agent;
  • projects: the space’s shared projectsDir is the agent’s working dir (agents.defaults.cwd), projects git-cloned once into it;
  • coding agents (Claude Code, Codex, OpenCode of the space): background workers (coding-agent skill), chat-bound sessions (/acp spawn, acpx);
  • Talk (talk): live voice conversation (browser, Android app), OpenAI GPT-Live (ChatGPT login first) or Gemini Live (GEMINI_API_KEY), work delegated to the agent (agent-consult);
  • workflows: Lobster pipelines (lobster, .lobster files through workspace), declared automations (automations, kept in sync, others left to the agent and the UI);
  • voice notes: whisper.cpp (transcription); on a microVM guest the hypervisor’s server (large-v3-turbo), local ggml small as fallback; local only on bare metal.
darkone.service.openclaw = {
workspace."AGENTS.md" = ./agents/AGENTS.md;
projects.notes = "git@forge.example.com:alice/notes.git";
};

Models: model + extraModels (/model in the chat), the owner’s subscriptions first, else an API key (apiKeys, sops openclaw/<VAR>); providers adds OpenAI-compatible endpoints (Nous Portal…).

  • enable bool Enable the OpenClaw assistant of an AI space

  • owner nullOr str Member owning the space: its subscription logs the agent in (model), it receives approval requests and proactive messages. Required with several members (users order is not kept).

  • cliUsers listOf str Members running the host CLI (openclaw) as the service user, by a sudo rule: TUI, provider logins, admin. Its ! shell commands run as openclaw too, the space’s tokens within reach.

  • model str Main model, <provider>/<model>: through the owner’s subscription when its provider is in subscriptions, else an API key (apiKeys).

  • extraModels listOf str Other models of the catalog, picked in the chat with /model; same rules as model.

  • subscriptions listOf ( enum [ "anthropic" "openai" ] ) Subscriptions of the owner, used first by the models of their provider:

    • anthropic: Claude Pro/Max through the claude CLI (needs darkone.host.ai-space.enableClaude);
    • openai: ChatGPT Plus/Pro through the codex plugin.

    Other providers, or one left out, go through an API key (apiKeys).

  • apiKeys listOf (strMatching "[A-Z][A-Z0-9_]*") Provider API keys, by variable: read from the space’s sops file (openclaw/<VAR>, just space-sops <host>) into the gateway environment. ANTHROPIC_API_KEY is dropped beside the anthropic subscription, which it would override.

  • providers attrs Providers absent from OpenClaw (Nous Portal…), OpenAI-compatible by default.

    • baseUrl str API endpoint.
    • api str API flavour (OpenClaw models.providers.<id>.api).
    • apiKey nullOr (strMatching "[A-Z][A-Z0-9_]*") Key variable, read like apiKeys.
    • models listOf str Model ids, referenced as <provider>/<id>.
  • mutableConfig bool Config writable from the UI and openclaw config set, the owner being operator admin. Nix keys merged at each start:

    • imposed, rewritten (also on any change of the file): gateway and access, Matrix channel, plugins, MCP servers, identity, store paths;
    • seeded, written when absent, then the UI rules: model, exec, talk, ACP, skill switches.
  • exec enum [ "full" "auto" "ask" "allowlist" "deny" ] Command policy of the agent (OpenClaw tools.exec.mode):

    • full: any command, unapproved (OpenClaw default);
    • ask: allowlisted commands run, any other asks the owner;
    • auto: a model reviews misses, the owner decides when it is unsure;
    • allowlist, deny: allowlisted commands only, none.

    Allowlist: openclaw approvals allowlist add --agent main <path>. With the claude-cli runtime, pipes, redirections and substitutions are refused before any prompt outside full.

  • identity.name nullOr str Name of the assistant, in the UI and on the Matrix bot (default there: the host’s name).

  • identity.emoji nullOr str Emoji of the assistant, in the UI; drawn as the Matrix bot’s avatar without avatar.

  • identity.avatar nullOr (either str path) Avatar of the assistant:

    • file (png, jpg, gif, webp; 2 MB at most for the UI) or https:// URL: UI and Matrix bot, uploaded by just space-init <host>;
    • path relative to the workspace: UI only, the emoji on Matrix.
  • matrixProfile raw Profile of the Matrix bot: display name, avatar and its fingerprint.

  • workspace attrs Files of the agent workspace, by relative path: content or file. Replaced at each gateway start; undeclared files belong to the agent.

  • projects attrs Git repositories cloned once into <projectsDir>/<name> (darkone.host.ai-space.projectsDir), never pulled. SSH remotes use the key of openclaw (/var/lib/openclaw/.ssh, created by hand); the server key is accepted on first clone.

  • talk.enable bool Talk: live voice conversation (browser, Android app)

  • talk.provider enum [ "openai" "google" ] Realtime voice:

    • openai: GPT-Live, browser WebRTC, SDP through the gateway;
    • google: Gemini Live, audio relayed by the gateway, needs GEMINI_API_KEY in apiKeys (Google AI Studio key).
  • talk.model str Realtime model, by provider:

    • openai: gpt-live-1-codex through the owner’s ChatGPT login (openclaw models auth login --provider openai), else a Platform key (OPENAI_API_KEY); gpt-live-1, gpt-realtime-2.1 (camera): Platform key only. Pinned: unset, a Platform key wins over ChatGPT;
    • google: gemini-3.1-flash-live-preview, gemini-3.8-live.
  • talk.voice str Voice of the model’s route:

    • gpt-live-1-codex: cove, arbor, breeze, ember, juniper, maple, sol, spruce, vale;
    • Gemini Live: Kore, Puck, Charon, Aoede, Zephyr… (30 prebuilt voices, listed in Settings → Talk).
  • talk.instructions nullOr lines Instructions appended to OpenClaw’s realtime prompt.

  • lobster bool Lobster workflows: pipelines run by the gateway, with approval steps and resume, plus llm-task (structured LLM step). Workflow files go through workspace ("workflows/<name>.lobster").

  • automations attrs Scheduled agent runs declared in Nix, kept in sync at each start (nix-<name>, edits from the UI overwritten); those of the agent and the UI are left alone.

    • schedule str Cron expression (5 or 6 fields), or every <duration> (every 2h).
    • message lines Prompt of the agent’s run.
    • announce bool Send the final reply to the chat (owner’s last channel).
    • model nullOr str Model override, <provider>/<model> or alias.
    • enable bool False: kept disabled; once so, re-enabled from the UI only (openclaw automations enable <id>).
  • transcription.enable bool Transcribe voice notes (whisper.cpp, CPU).

  • transcription.backend enum [ "hypervisor" "local" ] Where voice notes are transcribed:

    • hypervisor: the hypervisor’s whisper.cpp server (bigger model, more cores), model as fallback;
    • local: on this host, with model.
  • transcription.model path whisper.cpp ggml model of local transcription (local backend, fallback).

  • transcription.language str Spoken language (auto: detected per note).

darkone.service.openclaw = {
enable = false;
owner = "alice";
cliUsers = [ ];
model = "openai/gpt-6-astra";
extraModels = [ ];
subscriptions = [ ];
apiKeys = [ ];
providers.baseUrl = "https://inference-api.nousresearch.com/v1";
providers.api = "openai-completions";
providers.apiKey = "NOUS_API_KEY";
providers.models = [ ];
mutableConfig = false;
exec = "ask";
identity.name = "Jarvis";
identity.emoji = "🦉";
identity.avatar = lib.literalExpression "./jarvis.png";
matrixProfile = matrixProfile;
workspace = { };
projects = { };
talk.enable = false;
talk.provider = "google";
talk.model = {
openai = "gpt-live-1-codex";
google = "gemini-3.1-flash-live-preview";
}
.${cfg.talk.provider};
talk.voice = "sol";
talk.instructions = "Réponds en français, en phrases courtes.";
lobster = false;
automations.schedule = "0 7 * * 1-5";
automations.message = "";
automations.announce = true;
automations.model = null;
automations.enable = true;
transcription.enable = true;
transcription.backend = if config.darkone.system.microvm.hypervisor != null then "hypervisor" else "local";
transcription.model = pkgs.fetchurl {
url = "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.bin";
sha256 = "0ywqxbziyp2bv72riyjpw4brk9v46d4cfbjfwqvvjrrq0srakqqv";
};
transcription.language = "fr";
};

Source: modules/service/openclaw.nix 🡕