refactor: nix/host-modules + nix/agent-modules layout, update doc paths
This commit is contained in:
parent
cb755b677c
commit
4a48ce5024
52 changed files with 48 additions and 44 deletions
50
nix/agent-modules/docs.nix
Normal file
50
nix/agent-modules/docs.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
# In-container hyperhive reference docs: the `hyperhive.docs.*`
|
||||
# options and the `$HIVE_DOCS_DIR` wiring the harness reads.
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.hyperhive.docs.enable = lib.mkEnableOption ''
|
||||
make the hyperhive reference docs (the repo `docs/` tree, shipped
|
||||
read-only as the standalone `hyperhive-docs` derivation) available
|
||||
in-container. When enabled the harness exposes the docs dir to claude
|
||||
via `claude --add-dir`, so the markdown is readable at
|
||||
`$HIVE_DOCS_DIR/`, and appends a single pointer sentence to the agent's
|
||||
system prompt so it knows the docs exist (see
|
||||
`hive-ag3nt::prompt::render`). Default-on for the root/manager agent
|
||||
(see `../templates/ruth.nix`), off elsewhere; any agent can flip it from its
|
||||
`agent.nix`.
|
||||
'';
|
||||
|
||||
options.hyperhive.docs.source = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = config.hyperhive.packages.reference-docs;
|
||||
defaultText = lib.literalMD "`hyperhive.packages.reference-docs` (built from the repo `docs/` tree)";
|
||||
description = ''
|
||||
Store path of the reference-docs tree exposed at `$HIVE_DOCS_DIR`
|
||||
when `hyperhive.docs.enable` is set. Defaults to the flake's
|
||||
`reference-docs` package (the `nix/packages/reference-docs.nix`
|
||||
build) so a standalone container build from a full checkout
|
||||
works unchanged. The generated meta flake overrides this with the
|
||||
narrow `hyperhive-docs` flake input so a doc edit only
|
||||
re-locks that input instead of rebuilding the container from a
|
||||
re-hashed `hyperhive` source.
|
||||
'';
|
||||
};
|
||||
|
||||
config = {
|
||||
environment.variables = lib.mkIf config.hyperhive.docs.enable {
|
||||
# The harness reads HIVE_DOCS_DIR and passes it to claude as
|
||||
# `--add-dir` so the docs are readable, and appends a single
|
||||
# pointer sentence to the system prompt
|
||||
# (hive-ag3nt::prompt::render) telling the agent the docs exist.
|
||||
# Source is `hyperhive.docs.source` (the narrow `hyperhive-docs`
|
||||
# meta-flake input, or `pkgs.hyperhive-docs` for standalone
|
||||
# builds). See hive-ag3nt::turn.
|
||||
HIVE_DOCS_DIR = "${config.hyperhive.docs.source}";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Reference in a new issue