跳到正文
GitHub·· 7 天前AI 评分20

dryvist/nix-pi:为编码智能体 pi 提供 Nix 参考配置

dryvist/nix-pi

AI 导读

dryvist/nix-pi 发布了一套面向编码智能体 pi 的 Nix 参考配置,提供可复制的 Home Manager flake 模板,并补齐 Home Manager 尚未管理的 pi 文件选项。

正文

A reference Nix setup for pi, the coding agent: a Home Manager flake template to copy, plus a few Home Manager options for the pi files Home Manager does not manage yet.

Quick start

Start a new configuration from the template:

nix flake init -t github:dryvist/nix-pi

Change the values marked change me in flake.nix, then apply it with home-manager switch --flake .#me. Each setting in the template is commented and links to the pi or Home Manager docs it uses.

Or add the module to an existing Home Manager flake:

{
  inputs.nix-pi.url = "github:dryvist/nix-pi";
  # then add inputs.nix-pi.homeModules.default to your Home Manager modules
}

To try pi without installing anything: nix run github:dryvist/nix-pi.

Options

Home Manager's programs.pi-coding-agent writes settings.json, models.json, keybindings.json and AGENTS.md. This flake adds options to the same namespace for the other files pi reads from its agent directory:

Option Writes pi docs
system SYSTEM.md, replacing pi's system prompt configuration
skills.<path> skills/<path> skills
prompts.<path> prompts/<path>, one slash command per file prompt templates
extensions.<path> extensions/<path> extensions
themes.<path> themes/<path> themes

Each value is text or a path to a file or directory. Files go under programs.pi-coding-agent.configDir.

homeModules.default also sets programs.pi-coding-agent.package to this flake's pi. homeModules.pi-coding-agent adds only the options and keeps nixpkgs' pi-coding-agent.

Why it is set up this way

  • Pre-built package. pi comes from numtide/llm-agents.nix, which tracks pi releases and publishes binaries to its cache. That input keeps its own nixpkgs, so the cache matches and pi is downloaded instead of compiled.
  • Home Manager first. Use the upstream programs.pi-coding-agent options wherever they exist; this flake only fills the gaps, and drops an option once Home Manager ships it.
  • No scripts. Everything is plain Home Manager file declarations: no activation scripts or wrappers.
  • Read-only files. Each file is linked from the Nix store, so the configuration is the only place it changes, and rollbacks restore it.
  • No secrets in Nix. The store is world-readable; API keys are read at run time from an environment variable or a command.

Staying current

Your flake.lock pins pi, Home Manager and nixpkgs. Update them together with nix flake update, then switch.

Contributing

The .github workflows, renovate.json and AGENTS.md maintain this repository's CI; they are not part of the template. See AGENTS.md.

来源:GitHub · github.com