{
  "title": "Nix Installation",
  "content": "The recommended way to run OpenClaw with Nix is via **[nix-openclaw](https://github.com/openclaw/nix-openclaw)** — a batteries-included Home Manager module.\n\nPaste this to your AI agent (Claude, Cursor, etc.):\n\n> **📦 Full guide: [github.com/openclaw/nix-openclaw](https://github.com/openclaw/nix-openclaw)**\n>\n> The nix-openclaw repo is the source of truth for Nix installation. This page is just a quick overview.\n\n* Gateway + macOS app + tools (whisper, spotify, cameras) — all pinned\n* Launchd service that survives reboots\n* Plugin system with declarative config\n* Instant rollback: `home-manager switch --rollback`\n\n## Nix Mode Runtime Behavior\n\nWhen `OPENCLAW_NIX_MODE=1` is set (automatic with nix-openclaw):\n\nOpenClaw supports a **Nix mode** that makes configuration deterministic and disables auto-install flows.\nEnable it by exporting:\n\nOn macOS, the GUI app does not automatically inherit shell env vars. You can\nalso enable Nix mode via defaults:\n\n### Config + state paths\n\nOpenClaw reads JSON5 config from `OPENCLAW_CONFIG_PATH` and stores mutable data in `OPENCLAW_STATE_DIR`.\n\n* `OPENCLAW_STATE_DIR` (default: `~/.openclaw`)\n* `OPENCLAW_CONFIG_PATH` (default: `$OPENCLAW_STATE_DIR/openclaw.json`)\n\nWhen running under Nix, set these explicitly to Nix-managed locations so runtime state and config\nstay out of the immutable store.\n\n### Runtime behavior in Nix mode\n\n* Auto-install and self-mutation flows are disabled\n* Missing dependencies surface Nix-specific remediation messages\n* UI surfaces a read-only Nix mode banner when present\n\n## Packaging note (macOS)\n\nThe macOS packaging flow expects a stable Info.plist template at:\n\n[`scripts/package-mac-app.sh`](https://github.com/openclaw/openclaw/blob/main/scripts/package-mac-app.sh) copies this template into the app bundle and patches dynamic fields\n(bundle ID, version/build, Git SHA, Sparkle keys). This keeps the plist deterministic for SwiftPM\npackaging and Nix builds (which do not rely on a full Xcode toolchain).\n\n* [nix-openclaw](https://github.com/openclaw/nix-openclaw) — full setup guide\n* [Wizard](/start/wizard) — non-Nix CLI setup\n* [Docker](/install/docker) — containerized setup",
  "code_samples": [
    {
      "code": "> **📦 Full guide: [github.com/openclaw/nix-openclaw](https://github.com/openclaw/nix-openclaw)**\n>\n> The nix-openclaw repo is the source of truth for Nix installation. This page is just a quick overview.\n\n## What you get\n\n* Gateway + macOS app + tools (whisper, spotify, cameras) — all pinned\n* Launchd service that survives reboots\n* Plugin system with declarative config\n* Instant rollback: `home-manager switch --rollback`\n\n***\n\n## Nix Mode Runtime Behavior\n\nWhen `OPENCLAW_NIX_MODE=1` is set (automatic with nix-openclaw):\n\nOpenClaw supports a **Nix mode** that makes configuration deterministic and disables auto-install flows.\nEnable it by exporting:",
      "language": "unknown"
    },
    {
      "code": "On macOS, the GUI app does not automatically inherit shell env vars. You can\nalso enable Nix mode via defaults:",
      "language": "unknown"
    },
    {
      "code": "### Config + state paths\n\nOpenClaw reads JSON5 config from `OPENCLAW_CONFIG_PATH` and stores mutable data in `OPENCLAW_STATE_DIR`.\n\n* `OPENCLAW_STATE_DIR` (default: `~/.openclaw`)\n* `OPENCLAW_CONFIG_PATH` (default: `$OPENCLAW_STATE_DIR/openclaw.json`)\n\nWhen running under Nix, set these explicitly to Nix-managed locations so runtime state and config\nstay out of the immutable store.\n\n### Runtime behavior in Nix mode\n\n* Auto-install and self-mutation flows are disabled\n* Missing dependencies surface Nix-specific remediation messages\n* UI surfaces a read-only Nix mode banner when present\n\n## Packaging note (macOS)\n\nThe macOS packaging flow expects a stable Info.plist template at:",
      "language": "unknown"
    }
  ],
  "headings": [
    {
      "level": "h2",
      "text": "Quick Start",
      "id": "quick-start"
    },
    {
      "level": "h2",
      "text": "What you get",
      "id": "what-you-get"
    },
    {
      "level": "h2",
      "text": "Nix Mode Runtime Behavior",
      "id": "nix-mode-runtime-behavior"
    },
    {
      "level": "h3",
      "text": "Config + state paths",
      "id": "config-+-state-paths"
    },
    {
      "level": "h3",
      "text": "Runtime behavior in Nix mode",
      "id": "runtime-behavior-in-nix-mode"
    },
    {
      "level": "h2",
      "text": "Packaging note (macOS)",
      "id": "packaging-note-(macos)"
    },
    {
      "level": "h2",
      "text": "Related",
      "id": "related"
    }
  ],
  "url": "llms-txt#nix-installation",
  "links": []
}