Nix Installation
Der empfohlene Weg, OpenClaw mit Nix zu nutzen, ist nix-openclaw — ein Home Manager Modul mit allem, was du brauchst.
Schnellstart
Kopiere das hier in deinen AI Agent (Claude, Cursor, etc.):
I want to set up nix-openclaw on my Mac.
Repository: github:openclaw/nix-openclaw
What I need you to do:
1. Check if Determinate Nix is installed (if not, install it)
2. Create a local flake at ~/code/openclaw-local using templates/agent-first/flake.nix
3. Help me create a Telegram bot (@BotFather) and get my chat ID (@userinfobot)
4. Set up secrets (bot token, Anthropic key) - plain files at ~/.secrets/ is fine
5. Fill in the template placeholders and run home-manager switch
6. Verify: launchd running, bot responds to messages
Reference the nix-openclaw README for module options.
Vollständige Anleitung: github.com/openclaw/nix-openclaw
Das nix-openclaw Repo ist die zentrale Quelle für die Nix-Installation. Diese Seite gibt nur einen kurzen Überblick.
Was du bekommst
- Gateway + macOS App + Tools (whisper, spotify, cameras) — alles gepinnt
- Launchd Service, der Neustarts überlebt
- Plugin-System mit deklarativer Konfiguration
- Sofortiges Rollback:
home-manager switch --rollback
Nix Mode Laufzeitverhalten
Wenn OPENCLAW_NIX_MODE=1 gesetzt ist (automatisch bei nix-openclaw):
OpenClaw unterstützt einen Nix Mode, der die Konfiguration deterministisch macht und Auto-Install-Flows deaktiviert. Aktiviere ihn mit:
OPENCLAW_NIX_MODE=1
Auf macOS erbt die GUI-App nicht automatisch Shell-Umgebungsvariablen. Du kannst den Nix Mode auch über defaults aktivieren:
defaults write bot.molt.mac openclaw.nixMode -bool true
Config- und State-Pfade
OpenClaw liest JSON5-Konfiguration aus OPENCLAW_CONFIG_PATH und speichert veränderliche Daten in OPENCLAW_STATE_DIR.
OPENCLAW_STATE_DIR(Standard:~/.openclaw)OPENCLAW_CONFIG_PATH(Standard:$OPENCLAW_STATE_DIR/openclaw.json)
Unter Nix solltest du diese explizit auf Nix-verwaltete Orte setzen, damit Runtime-State und Config außerhalb des immutable Store bleiben.
Laufzeitverhalten im Nix Mode
- Auto-Install und Self-Mutation-Flows sind deaktiviert
- Fehlende Abhängigkeiten zeigen Nix-spezifische Lösungshinweise
- Die UI zeigt ein Read-only Nix Mode Banner an
Packaging-Hinweis (macOS)
Der macOS-Packaging-Flow erwartet ein stabiles Info.plist Template unter:
apps/macos/Sources/OpenClaw/Resources/Info.plist
scripts/package-mac-app.sh kopiert dieses Template ins App Bundle und patcht dynamische Felder (Bundle ID, Version/Build, Git SHA, Sparkle Keys). Das hält die plist deterministisch für SwiftPM-Packaging und Nix-Builds (die keine vollständige Xcode-Toolchain benötigen).
Verwandte Seiten
- nix-openclaw — vollständige Anleitung
- Wizard — CLI-Setup ohne Nix
- Docker — Container-basiertes Setup