Rename project to hermenix; convert host scripts to a Nu CLI

services.hermesVm -> services.hermenix throughout. setup.sh and
migrate-docker-hermes.sh are replaced by nu/hermenix.nu (setup + migrate
subcommands), packaged as a flake output (packages.${system}.hermenix,
pkgs.writers.writeNuBin) so it's installable without cloning conventions
beyond the repo itself. Both subcommands verified end-to-end against a
sandboxed dry run (stubbed disk/cache tools, a local ssh stand-in for the
migrate path) before landing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
ariandClaude Sonnet 5 committed 2026-09-15 13:26:18 -04:00
1 parent 12227460fd
commit 2b33b98bae
10 files changed
+570 -568

No files matched your search

+23 -18
View File
@@ -1,4 +1,4 @@
# Agent Guidelines — hermex
# Agent Guidelines — hermenix
Rules and best practices for any AI agent working in this repository.
Read this file before making any changes.
@@ -16,7 +16,7 @@ Your plan must include:
1. **What** you intend to change (files, modules, seed content)
2. **Why** the change is needed
3. **How** you will do it (which files you will edit, in what order)
4. **What you will NOT do** (e.g., "I will not run setup.sh or build the image")
4. **What you will NOT do** (e.g., "I will not run hermenix setup or build the image")
Only after the user approves the plan may you proceed with edits.
@@ -31,25 +31,28 @@ Only after the user approves the plan may you proceed with edits.
```
nix build
nix flake check
./setup.sh # unless the user is actively running it themselves with you watching
hermenix setup # unless the user is actively running it themselves with you watching
hermenix migrate # same — it writes into a live guest
dd ... of=/var/lib/hermes-vm/** # writing any disk image
nixos-rebuild switch / test / build (on any host consuming this flake)
```
**Why:**
- `setup.sh` creates/writes disk images and generates host secrets (a binary
cache signing key) — destructive if repeated carelessly, and it's the
operator's host, not yours to act on.
- `hermenix setup` creates/writes disk images and generates host secrets (a
binary cache signing key) — destructive if repeated carelessly, and it's
the operator's host, not yours to act on.
- `hermenix migrate` writes into a running guest and rewrites its config,
even though it never touches the migration source.
- A `nixos-rebuild switch` on a consuming host is a live, production-affecting
action — for `hl-fwdesk` specifically, it's the machine running the
operator's actual daily-use Hermes deployment.
- These commands can take a long time and consume real resources on a
machine you don't control from here.
**Your job:** Write good Nix and good docs. The operator runs `setup.sh`, the
image build, and any `nixos-rebuild` themselves, on the host, watching each
step.
**Your job:** Write good Nix, good Nu, and good docs. The operator runs
`hermenix setup`, `hermenix migrate`, the image build, and any
`nixos-rebuild` themselves, on the host, watching each step.
### ❌ NEVER run `hermes-vm rollback` or `hermes-ctl reseed` without fresh confirmation
@@ -74,9 +77,9 @@ after. Real credentials belong in the guest's own `~/.hermes/.env`
### ❌ NEVER move or delete source data during a migration
When carrying over an existing Hermes deployment (see
`migrate-docker-hermes.sh`), only ever read from and copy the source. Leave
it in place and untouched until the operator has verified the new deployment
When carrying over an existing Hermes deployment (see `nu/hermenix.nu`'s
`migrate` subcommand), only ever read from and copy the source. Leave it in
place and untouched until the operator has verified the new deployment
end-to-end. This is the rollback safety net — don't remove it.
### ❌ NEVER commit or push unless explicitly asked
@@ -93,6 +96,9 @@ These are always safe to perform without asking:
- Reading any file in this repo
- Editing `modules/host.nix` to add/adjust options (gated behind `mkIf
cfg.enable`, following the existing style)
- Editing `nu/hermenix.nu` — check any change by parsing it (`nu
nu/hermenix.nu --help` and `nu nu/hermenix.nu <subcommand> --help` parse
the whole file without running any subcommand body) before handing it back
- Editing `guest/hermes/home` / `guest/hermes/workspace` template seed content
(as long as it stays free of real secrets — see above)
- Editing `README.md` / `GUIDELINES.md` / `AGENTS.md`
@@ -110,11 +116,10 @@ don't run it.** Describe what you would do and ask.
## Repository Layout
```
hermex/
├── flake.nix # bootstrap flake: builds the guest image, exposes nixosModules.default
├── modules/host.nix # services.hermesVm — the host-side NixOS module
├── setup.sh # guided host-side setup (disks, cache key, image build)
├── migrate-docker-hermes.sh # carries an existing flat HERMES_HOME into a hermex guest
hermenix/
├── flake.nix # bootstrap flake: builds the guest image + the hermenix CLI package, exposes nixosModules.default
├── modules/host.nix # services.hermenix — the host-side NixOS module
├── nu/hermenix.nu # the hermenix CLI: `setup` (guided host-side setup) and `migrate` (carry over existing data)
├── guest/
│ ├── flake.nix # the GUEST's own /etc/nixos flake — belongs to the agent, not the operator
│ ├── common.nix # guest NixOS config baked into the bootstrap image
@@ -122,5 +127,5 @@ hermex/
│ └── hermes/
│ ├── home/ # template seed -> ~/.hermes on first boot (SOUL.md, config.yaml, memories/, skills/)
│ └── workspace/ # template seed -> ~/workspace on first boot
└── README.md # full usage docs
└── README.md # full usage docs
```