{"id":165,"date":"2026-03-21T22:47:20","date_gmt":"2026-03-21T14:47:20","guid":{"rendered":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/install-nix\/"},"modified":"2026-03-21T23:23:49","modified_gmt":"2026-03-21T15:23:49","slug":"install-nix","status":"publish","type":"post","link":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/install-nix\/","title":{"rendered":"Nix"},"content":{"rendered":"<h1>Nix<\/h1>\n<h1>Nix &#23433;&#35013;<\/h1>\n<p>&#20351;&#29992; Nix &#36816;&#34892; OpenClaw &#30340;&#25512;&#33616;&#26041;&#24335;&#26159;&#36890;&#36807; <strong><a href=\"https:\/\/github.com\/openclaw\/nix-openclaw\">nix-openclaw<\/a><\/strong> &mdash; &#19968;&#20010;&#24320;&#31665;&#21363;&#29992;&#30340; Home Manager &#27169;&#22359;&#12290;<\/p>\n<h2>&#24555;&#36895;&#24320;&#22987;<\/h2>\n<p>&#23558;&#27492;&#31896;&#36148;&#32473;&#20320;&#30340; AI &#26234;&#33021;&#20307;&#65288;Claude&#12289;Cursor &#31561;&#65289;&#65306;<\/p>\n<p>&#8220;`text  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nI want to set up nix-openclaw on my Mac.<br \/>\nRepository: github:openclaw\/nix-openclaw<\/p>\n<p>What I need you to do:<br \/>\n1. Check if Determinate Nix is installed (if not, install it)<br \/>\n2. Create a local flake at ~\/code\/openclaw-local using templates\/agent-first\/flake.nix<br \/>\n3. Help me create a Telegram bot (@BotFather) and get my chat ID (@userinfobot)<br \/>\n4. Set up secrets (bot token, Anthropic key) &#8211; plain files at ~\/.secrets\/ is fine<br \/>\n5. Fill in the template placeholders and run home-manager switch<br \/>\n6. Verify: launchd running, bot responds to messages<\/p>\n<p>Reference the nix-openclaw README for module options.<\/p>\n<pre><code>\n&gt; **&#128230; &#23436;&#25972;&#25351;&#21335;&#65306;[github.com\/openclaw\/nix-openclaw](https:\/\/github.com\/openclaw\/nix-openclaw)**\n&gt;\n&gt; nix-openclaw &#20179;&#24211;&#26159; Nix &#23433;&#35013;&#30340;&#26435;&#23041;&#26469;&#28304;&#12290;&#26412;&#39029;&#21482;&#26159;&#19968;&#20010;&#24555;&#36895;&#27010;&#36848;&#12290;\n\n## &#20320;&#23558;&#33719;&#24471;\n\n* Gateway &#32593;&#20851; + macOS &#24212;&#29992; + &#24037;&#20855;&#65288;whisper&#12289;spotify&#12289;cameras&#65289;&mdash; &#20840;&#37096;&#22266;&#23450;&#29256;&#26412;\n* &#37325;&#21551;&#21518;&#20173;&#33021;&#36816;&#34892;&#30340; Launchd &#26381;&#21153;\n* &#24102;&#26377;&#22768;&#26126;&#24335;&#37197;&#32622;&#30340;&#25554;&#20214;&#31995;&#32479;\n* &#21363;&#26102;&#22238;&#28378;&#65306;`home-manager switch --rollback`\n\n***\n\n## Nix &#27169;&#24335;&#36816;&#34892;&#26102;&#34892;&#20026;\n\n&#24403;&#35774;&#32622; `OPENCLAW_NIX_MODE=1` &#26102;&#65288;nix-openclaw &#20250;&#33258;&#21160;&#35774;&#32622;&#65289;&#65306;\n\nOpenClaw &#25903;&#25345; **Nix &#27169;&#24335;**&#65292;&#20351;&#37197;&#32622;&#30830;&#23450;&#24615;&#24182;&#31105;&#29992;&#33258;&#21160;&#23433;&#35013;&#27969;&#31243;&#12290;\n&#36890;&#36807;&#23548;&#20986;&#20197;&#19979;&#29615;&#22659;&#21464;&#37327;&#21551;&#29992;&#65306;\n\n```bash  theme={\"theme\":{\"light\":\"min-light\",\"dark\":\"min-dark\"}}\nOPENCLAW_NIX_MODE=1\n<\/code><\/pre>\n<p>&#22312; macOS &#19978;&#65292;GUI &#24212;&#29992;&#19981;&#20250;&#33258;&#21160;&#32487;&#25215; shell &#29615;&#22659;&#21464;&#37327;&#12290;&#20320;&#20063;&#21487;&#20197;&#36890;&#36807; defaults &#21551;&#29992; Nix &#27169;&#24335;&#65306;<\/p>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\ndefaults write bot.molt.mac openclaw.nixMode -bool true<\/p>\n<pre><code>\n### &#37197;&#32622; + &#29366;&#24577;&#36335;&#24452;\n\nOpenClaw &#20174; `OPENCLAW_CONFIG_PATH` &#35835;&#21462; JSON5 &#37197;&#32622;&#65292;&#24182;&#23558;&#21487;&#21464;&#25968;&#25454;&#23384;&#20648;&#22312; `OPENCLAW_STATE_DIR` &#20013;&#12290;\n\n* `OPENCLAW_STATE_DIR`&#65288;&#40664;&#35748;&#65306;`~\/.openclaw`&#65289;\n* `OPENCLAW_CONFIG_PATH`&#65288;&#40664;&#35748;&#65306;`$OPENCLAW_STATE_DIR\/openclaw.json`&#65289;\n\n&#22312; Nix &#19979;&#36816;&#34892;&#26102;&#65292;&#23558;&#36825;&#20123;&#26174;&#24335;&#35774;&#32622;&#20026; Nix &#31649;&#29702;&#30340;&#20301;&#32622;&#65292;&#20197;&#20415;&#36816;&#34892;&#26102;&#29366;&#24577;&#21644;&#37197;&#32622;&#19981;&#20250;&#36827;&#20837;&#19981;&#21487;&#21464;&#23384;&#20648;&#12290;\n\n### Nix &#27169;&#24335;&#19979;&#30340;&#36816;&#34892;&#26102;&#34892;&#20026;\n\n* &#33258;&#21160;&#23433;&#35013;&#21644;&#33258;&#25105;&#20462;&#25913;&#27969;&#31243;&#34987;&#31105;&#29992;\n* &#32570;&#22833;&#30340;&#20381;&#36182;&#20250;&#26174;&#31034; Nix &#29305;&#23450;&#30340;&#20462;&#22797;&#28040;&#24687;\n* &#23384;&#22312;&#26102; UI &#20250;&#26174;&#31034;&#21482;&#35835; Nix &#27169;&#24335;&#27178;&#24133;\n\n## &#25171;&#21253;&#27880;&#24847;&#20107;&#39033;&#65288;macOS&#65289;\n\nmacOS &#25171;&#21253;&#27969;&#31243;&#26399;&#26395;&#22312;&#20197;&#19979;&#20301;&#32622;&#26377;&#19968;&#20010;&#31283;&#23450;&#30340; Info.plist &#27169;&#26495;&#65306;\n\n<\/code><\/pre>\n<p>apps\/macos\/Sources\/OpenClaw\/Resources\/Info.plist<br \/>\n&#8220;`<\/p>\n<p><a href=\"https:\/\/github.com\/openclaw\/openclaw\/blob\/main\/scripts\/package-mac-app.sh\"><code>scripts\/package-mac-app.sh<\/code><\/a> &#23558;&#27492;&#27169;&#26495;&#22797;&#21046;&#21040;&#24212;&#29992;&#21253;&#20013;&#24182;&#20462;&#34917;&#21160;&#24577;&#23383;&#27573;&#65288;bundle ID&#12289;&#29256;&#26412;\/&#26500;&#24314;&#21495;&#12289;Git SHA&#12289;Sparkle &#23494;&#38053;&#65289;&#12290;&#36825;&#20351; plist &#23545;&#20110; SwiftPM &#25171;&#21253;&#21644; Nix &#26500;&#24314;&#20445;&#25345;&#30830;&#23450;&#24615;&#65288;&#23427;&#20204;&#19981;&#20381;&#36182;&#23436;&#25972;&#30340; Xcode &#24037;&#20855;&#38142;&#65289;&#12290;<\/p>\n<h2>&#30456;&#20851;&#20869;&#23481;<\/h2>\n<ul>\n<li><a href=\"https:\/\/github.com\/openclaw\/nix-openclaw\">nix-openclaw<\/a> &mdash; &#23436;&#25972;&#35774;&#32622;&#25351;&#21335;<\/li>\n<li><a href=\"\/start\/wizard\">&#21521;&#23548;<\/a> &mdash; &#38750; Nix CLI &#35774;&#32622;<\/li>\n<li><a href=\"\/install\/docker\">Docker<\/a> &mdash; &#23481;&#22120;&#21270;&#35774;&#32622;<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Nix Nix &#23433;&#35013; &#20351;&#29992; Nix &#36816;&#038; [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-165","post","type-post","status-publish","format-standard","hentry","category-docs"],"_links":{"self":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/comments?post=165"}],"version-history":[{"count":2,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/165\/revisions"}],"predecessor-version":[{"id":800,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/165\/revisions\/800"}],"wp:attachment":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/media?parent=165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/categories?post=165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/tags?post=165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}