From 1c8d38a8078d2a9eab41d8f1f7374af59e0153b6 Mon Sep 17 00:00:00 2001 From: alexion Date: Sat, 5 Sep 2026 17:56:15 -0400 Subject: [PATCH] fix(nixos): deploy Pi extensions globally --- configs/nixos/AGENTS.md | 2 ++ configs/nixos/modules/shell/herdr.nix | 2 -- configs/nixos/modules/shell/pi/default.nix | 14 +++++++++++--- .../modules/shell/pi}/extensions/compact-status.ts | 0 .../shell/pi}/extensions/herdr-agent-state.ts | 0 5 files changed, 13 insertions(+), 5 deletions(-) rename {.pi => configs/nixos/modules/shell/pi}/extensions/compact-status.ts (100%) rename {.pi => configs/nixos/modules/shell/pi}/extensions/herdr-agent-state.ts (100%) diff --git a/configs/nixos/AGENTS.md b/configs/nixos/AGENTS.md index 27dd8fa..e2b862f 100644 --- a/configs/nixos/AGENTS.md +++ b/configs/nixos/AGENTS.md @@ -32,6 +32,8 @@ - Use produced literals for Herdr key names that include shifted punctuation. For example, use `prefix+<` instead of `prefix+shift+comma`. +- Put global Pi extension sources in `configs/nixos/modules/shell/pi/extensions/`. + Home Manager deploys them to `~/.pi/agent/extensions/`. - Treat Home Manager-managed Pi extension, prompt, and skill directories as generated output. Do not edit those directories except for throwaway development or local experiments. Promote finished work into the NixOS configuration before treating it as deployed. diff --git a/configs/nixos/modules/shell/herdr.nix b/configs/nixos/modules/shell/herdr.nix index e2c530d..b3d1709 100644 --- a/configs/nixos/modules/shell/herdr.nix +++ b/configs/nixos/modules/shell/herdr.nix @@ -18,8 +18,6 @@ in home-manager.users.${user} = { home.packages = [ pkgs.herdr ]; - # Refresh the vendored project-local Pi extension from the monorepo root. - # Run `PI_CODING_AGENT_DIR=$PWD/.pi herdr integration install pi`. xdg.configFile."herdr/config.toml".text = '' [keys] prefix = "ctrl+space" diff --git a/configs/nixos/modules/shell/pi/default.nix b/configs/nixos/modules/shell/pi/default.nix index feb1ae6..17921b9 100644 --- a/configs/nixos/modules/shell/pi/default.nix +++ b/configs/nixos/modules/shell/pi/default.nix @@ -40,9 +40,17 @@ in }; }; - # The first declarative rollout replaces the interactive settings file. - # Login state stays in auth.json, which this module does not manage. - home.file."${piDir}/settings.json".force = true; + home.file = { + # The first declarative rollout replaces the interactive settings file. + # Login state stays in auth.json, which this module does not manage. + "${piDir}/settings.json".force = true; + + "${piDir}/extensions" = { + source = ./extensions; + recursive = true; + force = true; + }; + }; }; }; } diff --git a/.pi/extensions/compact-status.ts b/configs/nixos/modules/shell/pi/extensions/compact-status.ts similarity index 100% rename from .pi/extensions/compact-status.ts rename to configs/nixos/modules/shell/pi/extensions/compact-status.ts diff --git a/.pi/extensions/herdr-agent-state.ts b/configs/nixos/modules/shell/pi/extensions/herdr-agent-state.ts similarity index 100% rename from .pi/extensions/herdr-agent-state.ts rename to configs/nixos/modules/shell/pi/extensions/herdr-agent-state.ts