使用 Nix 运行 OpenClaw 的推荐方式是通过nix-openclaw— 一个开箱即用的 Home Manager 模块。
将此粘贴给你的 智能体(Claude、Cursor 等):
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 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.
*? 完整指南:github.com/openclaw/nix-openclawnix-openclaw 仓库是 Nix 安装的权威来源。本页只是一个快速概述。
当设置时(nix-openclaw 会自动设置): OpenClaw 支持Nix 模式,使配置确定性并禁用自动安装流程。 通过导出以下环境变量启用:
在 macOS 上,GUI 应用不会自动继承 shell 环境变量。你也可以通过 defaults 启用 Nix 模式:
defaults write bot.molt.mac openclaw.nixMode -bool true
OpenClaw 从读取 JSON5 配置,并将可变数据存储在中。
在 Nix 下运行时,将这些显式设置为 Nix 管理的位置,以便运行时状态和配置不会进入不可变存储。
macOS 打包流程期望在以下位置有一个稳定的 Info.plist 模板:
apps/macos/Sour/OpenClaw/Resources/Info.plist
将此模板复制到应用包中并修补动态字段(bundle ID、版本/构建号、Git SHA、Sparkle 密钥)。这使 plist 对于 SwiftPM 打包和 Nix 构建保持确定性(它们不依赖完整的 Xcode 工具链)。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/227441.html