[{"data":1,"prerenderedAt":281},["ShallowReactive",2],{"navigation_docs_zh_CN":3,"\u002Fzh-CN\u002Fgetting-started\u002Finstallation":85,"\u002Fzh-CN\u002Fgetting-started\u002Finstallation-surround":278},[4,19,41,75],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":18},"快速开始","i-lucide-book-open","\u002Fzh-CN\u002Fgetting-started","zh-CN\u002F1.getting-started",[10,14],{"title":11,"path":12,"stem":13},"安装","\u002Fzh-CN\u002Fgetting-started\u002Finstallation","zh-CN\u002F1.getting-started\u002F1.installation",{"title":15,"path":16,"stem":17},"第一个 Pin","\u002Fzh-CN\u002Fgetting-started\u002Ffirst-pin","zh-CN\u002F1.getting-started\u002F2.first-pin",false,{"title":20,"icon":21,"path":22,"stem":23,"children":24,"page":18},"使用指南","i-lucide-route","\u002Fzh-CN\u002Fguides","zh-CN\u002F2.guides",[25,29,33,37],{"title":26,"path":27,"stem":28},"更新与选择","\u002Fzh-CN\u002Fguides\u002Fupdating","zh-CN\u002F2.guides\u002F1.updating",{"title":30,"path":31,"stem":32},"组合 Checker 与 Fetcher","\u002Fzh-CN\u002Fguides\u002Fcombinations","zh-CN\u002F2.guides\u002F2.combinations",{"title":34,"path":35,"stem":36},"多 Source 与补丁","\u002Fzh-CN\u002Fguides\u002Fmulti-source","zh-CN\u002F2.guides\u002F3.multi-source",{"title":38,"path":39,"stem":40},"Package 与依赖哈希","\u002Fzh-CN\u002Fguides\u002Fdependencies","zh-CN\u002F2.guides\u002F4.dependencies",{"title":42,"icon":43,"path":44,"stem":45,"children":46,"page":18},"参考文档","i-lucide-code","\u002Fzh-CN\u002Freference","zh-CN\u002F3.reference",[47,51,55,59,63,67,71],{"title":48,"path":49,"stem":50},"CLI","\u002Fzh-CN\u002Freference\u002Fcli","zh-CN\u002F3.reference\u002F1.cli",{"title":52,"path":53,"stem":54},"运行配置","\u002Fzh-CN\u002Freference\u002Fconfiguration","zh-CN\u002F3.reference\u002F2.configuration",{"title":56,"path":57,"stem":58},"Pin 声明","\u002Fzh-CN\u002Freference\u002Fpins","zh-CN\u002F3.reference\u002F3.pins",{"title":60,"path":61,"stem":62},"Checker","\u002Fzh-CN\u002Freference\u002Fcheckers","zh-CN\u002F3.reference\u002F4.checkers",{"title":64,"path":65,"stem":66},"Fetcher","\u002Fzh-CN\u002Freference\u002Ffetchers","zh-CN\u002F3.reference\u002F5.fetchers",{"title":68,"path":69,"stem":70},"Package Builder","\u002Fzh-CN\u002Freference\u002Fbuilders","zh-CN\u002F3.reference\u002F6.builders",{"title":72,"path":73,"stem":74},"Reader 与 Pins File","\u002Fzh-CN\u002Freference\u002Freader","zh-CN\u002F3.reference\u002F7.reader",{"title":76,"icon":77,"path":78,"stem":79,"children":80,"page":18},"排错指南","i-lucide-wrench","\u002Fzh-CN\u002Ftroubleshooting","zh-CN\u002F4.troubleshooting",[81],{"title":82,"path":83,"stem":84},"常见错误","\u002Fzh-CN\u002Ftroubleshooting\u002Fcommon-errors","zh-CN\u002F4.troubleshooting\u002F1.common-errors",{"id":86,"title":11,"body":87,"description":271,"extension":272,"links":273,"meta":274,"navigation":275,"path":12,"seo":276,"stem":13,"__hash__":277},"docs_zh_CN\u002Fzh-CN\u002F1.getting-started\u002F1.installation.md",{"type":88,"value":89,"toc":266},"minimark",[90,99,104,122,129,145,148,157,164,168,175,197,200,203,206,232,250,257,262],[91,92,93,94,98],"p",{},"nix-pins 是一个 Rust CLI。运行时需要可用的 Nix，以及配置使用的 Nixpkgs。使用 Git Checker 时还需要 ",[95,96,97],"code",{},"git","。",[100,101,103],"h2",{"id":102},"准备-nix","准备 Nix",[91,105,106,107,114,115,118,119,98],{},"安装方式见 ",[108,109,113],"a",{"href":110,"rel":111},"https:\u002F\u002Fnix.dev\u002Finstall-nix",[112],"nofollow","Nix 官方安装指南","。下面的 Flake 命令需要启用 ",[95,116,117],{},"nix-command"," 和 ",[95,120,121],{},"flakes",[91,123,124,125,128],{},"CLI 的默认 evaluator 使用 ",[95,126,127],{},"\u003Cnixpkgs>","。先确认它可以被解析：",[130,131,136],"pre",{"className":132,"code":133,"language":134,"meta":135,"style":135},"language-sh shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","nix eval --impure --raw --expr 'toString \u003Cnixpkgs>'\n","sh","",[95,137,138],{"__ignoreMap":135},[139,140,143],"span",{"class":141,"line":142},"line",1,[139,144,133],{},[91,146,147],{},"如果没有配置 Nixpkgs 路径，可为当前终端设置：",[130,149,151],{"className":132,"code":150,"language":134,"meta":135,"style":135},"export NIX_PATH=\"nixpkgs=$(nix eval --raw nixpkgs#path)\"\n",[95,152,153],{"__ignoreMap":135},[139,154,155],{"class":141,"line":142},[139,156,150],{},[91,158,159,160,163],{},"项目需要固定 Nixpkgs 时，将 ",[95,161,162],{},"NIX_PATH"," 指向该项目已经锁定的 Nixpkgs 源码。CLI 求值和下游 Reader 应使用兼容的 Nixpkgs，尤其是涉及依赖 Builder 时。",[100,165,167],{"id":166},"使用-flake","使用 Flake",[91,169,170,171,174],{},"当前仓库的 Flake 输出仅定义了 ",[95,172,173],{},"aarch64-darwin","，即 Apple Silicon macOS。该平台可执行：",[130,176,178],{"className":132,"code":177,"language":134,"meta":135,"style":135},"nix run github:ercao\u002Fnix-pins -- --help\nnix profile install github:ercao\u002Fnix-pins\nnix-pins --version\n",[95,179,180,185,191],{"__ignoreMap":135},[139,181,182],{"class":141,"line":142},[139,183,184],{},"nix run github:ercao\u002Fnix-pins -- --help\n",[139,186,188],{"class":141,"line":187},2,[139,189,190],{},"nix profile install github:ercao\u002Fnix-pins\n",[139,192,194],{"class":141,"line":193},3,[139,195,196],{},"nix-pins --version\n",[91,198,199],{},"其他平台可从源码用 Cargo 构建；当前 Flake 没有为这些平台提供 package 或 app 输出。",[100,201,202],{"id":202},"从源码安装",[91,204,205],{},"准备 Rust 工具链和 Nix，克隆源码后安装：",[130,207,209],{"className":132,"code":208,"language":134,"meta":135,"style":135},"git clone https:\u002F\u002Fgithub.com\u002Fercao\u002Fnix-pins.git\ncd nix-pins\ncargo install --path crates\u002Fcli --locked\nnix-pins --help\n",[95,210,211,216,221,226],{"__ignoreMap":135},[139,212,213],{"class":141,"line":142},[139,214,215],{},"git clone https:\u002F\u002Fgithub.com\u002Fercao\u002Fnix-pins.git\n",[139,217,218],{"class":141,"line":187},[139,219,220],{},"cd nix-pins\n",[139,222,223],{"class":141,"line":193},[139,224,225],{},"cargo install --path crates\u002Fcli --locked\n",[139,227,229],{"class":141,"line":228},4,[139,230,231],{},"nix-pins --help\n",[91,233,234,235,238,239,242,243,246,247,98],{},"将 Cargo 的安装目录（通常是 ",[95,236,237],{},"~\u002F.cargo\u002Fbin","）加入 ",[95,240,241],{},"PATH","。也可以在仓库内使用 ",[95,244,245],{},"cargo run -- status"," 或 ",[95,248,249],{},"cargo run -- update",[91,251,252,253,256],{},"Reader 位于源码仓库的 ",[95,254,255],{},"nix\u002Fpins.nix","。当前 Flake package 安装 CLI、evaluator 和 Reader；本教程从克隆的仓库导入 Reader。将 Reader 用于其他项目时，保留或固定对应的工具源码版本。",[91,258,259,260,98],{},"接下来完成",[108,261,15],{"href":16},[263,264,265],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":135,"searchDepth":187,"depth":187,"links":267},[268,269,270],{"id":102,"depth":187,"text":103},{"id":166,"depth":187,"text":167},{"id":202,"depth":187,"text":202},"准备 Nix 与 nix-pins，选择 Flake 或 Cargo 安装方式。","md",null,{},true,{"title":11,"description":271},"WqxxYSqOtnK8-ya_18qVYi5lNymiVI7Tqh7l63SEMsY",[273,279],{"title":15,"path":16,"stem":17,"description":280,"children":-1},"从一个 GitHub 示例开始，完成版本检查、源码锁定与 Nix 消费。",1790868072660]