From ddbf933b331350fa0adc73238394c0dc55fbeb3c Mon Sep 17 00:00:00 2001 From: chumeng <2595248810@qq.com> Date: Sun, 18 Oct 2026 13:58:01 +0800 Subject: [PATCH] docs: install mcpp with Nix from mcpp-community/nix-mcpp --- README.md | 18 +++++++++++++++++- README.zh-CN.md | 14 +++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1f5ed1279..c1152f5fb 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,23 @@ environment. On PyPI the name `mcpp` belongs to an unrelated project, hence
-Option 5 — let an AI assistant install it for you +Option 5 — Nix (flake) + +```bash +nix run github:mcpp-community/nix-mcpp -- --version # try it +nix profile install github:mcpp-community/nix-mcpp # install it +``` + +The flake in [`mcpp-community/nix-mcpp`](https://github.com/mcpp-community/nix-mcpp) +packages the same prebuilt release binary for Linux x86_64 / aarch64 and macOS +on Apple silicon, and follows each stable release. Its overlay adds +`pkgs.mcpp-bin`: nixpkgs' `mcpp` is an unrelated C preprocessor. Per-user data +still lives in `~/.mcpp/`. + +
+ +
+Option 6 — let an AI assistant install it for you Copy the following prompt to your AI coding assistant (Claude Code / Cursor / Copilot, etc.): diff --git a/README.zh-CN.md b/README.zh-CN.md index 118ad709e..ac706281f 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -162,7 +162,19 @@ pip install mcpp-bin
-方式 5:由 AI 助手安装 +方式 5:Nix(flake) + +```bash +nix run github:mcpp-community/nix-mcpp -- --version # 试用 +nix profile install github:mcpp-community/nix-mcpp # 安装 +``` + +[`mcpp-community/nix-mcpp`](https://github.com/mcpp-community/nix-mcpp) 中的 flake 打包的是同一份预编译 release 二进制,支持 Linux x86_64 / aarch64 与 Apple 芯片上的 macOS,并跟随每个稳定版更新。它的 overlay 提供 `pkgs.mcpp-bin`,因为 nixpkgs 中的 `mcpp` 是一个无关的 C 预处理器。每个用户的数据仍在各自的 `~/.mcpp/` 中。 + +
+ +
+方式 6:由 AI 助手安装 将以下提示词发给 AI 编码助手(Claude Code、Cursor、Copilot 等):