Pi nix syntax

From edmundmiller/dotfiles · View interactive version

Pi nix syntax is an AI agent skill from the GitHub repository edmundmiller/dotfiles. Maps Pi packages, extensions, and skills to this repository's Nix ownership. Use when converting between Pi setup instructions and declarative dotfiles.

How to use this skill

Skill file

Pi ↔ Nix syntax conversions (this repo)

This repo intentionally splits responsibilities:

via agent-skills-nix (child flake skills/). Package-native skills remain

an explicit exception.

If you see skills collisions, it usually means skills were enabled both ways.

Canonical mapping

1) Pi settings.jsonc packages → stays Pi syntax (no Nix rewrite)

If the thing you’re converting is a Pi packages entry like:

{
  "source": "git:github.com/tmustier/pi-extensions",
  "extensions": ["tab-status/tab-status.ts"],
  "skills": [],
}

…then in this repo it should generally remain a config/pi/settings.jsonc entry.

Nix only ensures the file gets placed at ~/.pi/agent/settings.json.

2) Local extension file → Nix home.file symlink

Pi-style: “I want this TS file to be a Pi extension.”

Nix-style (this repo):

  1. Put code in:
  1. Link it into Pi extensions dir via:

Rule: anything under ~/.pi/agent/extensions/*.ts must default-export a factory.

3) Pi skills → agent-skills-nix catalog

Do not use config/pi/settings.jsonc packages[].skills for shared skills that

agent-skills-nix manages. Preserve intentionally package-native resources, such

as pi-amplike's bundled session-query skill, unless they collide with a

catalog-managed copy.

Instead:

skills.enableAll = [ "catalog" ];

the global catalog.

programs.dotfiles-agent-skills.targetedExplicit.<skillId> with

meta.targets = [ "pi" ];

After changing a remote input, update the child lock and then synchronize the

parent lock through the guarded repository command:

cd skills && nix flake lock --update-input <src>
cd .. && hey skills-sync

Rule: avoid nested-symlink collisions by flattening nested IDs (example: skill-creator instead of extending-pi/skill-creator).

Conversions

Pi → Nix (how to implement in this repo)

Given a Pi-ish request, classify it:

  1. Remote extension package (git:, npm:, https:):
  1. Local extension (your own .ts):
  1. Skill (SKILL.md):

skills/catalog/<name>/SKILL.md.

.agents/skills/<name>/SKILL.md.

deliberate package-native skills when they have no catalog-managed copy.

Nix → Pi (how to express the effective Pi result)

  1. If Nix is linking a file into ~/.pi/agent/extensions/<x>.ts, then the Pi-side view is simply:
  1. If Nix is generating ~/.pi/agent/settings.json from config/pi/settings.jsonc, then the Pi-side view is:
  1. If Nix installs skills via agent-skills-nix, then the Pi-side view is:

~/.pi/agent/skills/<name>/SKILL.md.”

Quick templates

Add a new shared skill

Add a dotfiles-only project skill

Add a new local extension

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.