refactor: remove legacy mkOpencodeRules alias and opencode-rules compat entry

- Remove mkOpencodeRules backward-compat alias from lib/coding-rules.nix
- Remove opencode-rules alias from lib/default.nix
- Update shells/opencode.nix to use mkCodingRules / coding-rules
- Remove backward-compat test from tests/lib/coding-rules-test.nix
- Update AGENTS.md and modules/home-manager/AGENTS.md docs
- Apply nix fmt formatting to shared-options.nix
This commit is contained in:
sascha.koenig
2026-04-20 19:16:22 +02:00
parent 35f4821bc5
commit 57ebad1358
8 changed files with 22 additions and 30 deletions

View File

@@ -163,7 +163,7 @@ The agent system was migrated from embedded `agents.json` to file-based canonica
| `coding.opencode.externalSkills` | `coding.agents.opencode.externalSkills` |
| Agents embedded in `config.json` | File-based `~/.config/opencode/agents/*.md` |
| Model hardcoded in `agents.json` | Per-machine `modelOverrides` |
| `mkOpencodeRules` | `mkCodingRules` (old name still works) |
| `mkOpencodeRules` | `mkCodingRules` |
### Migration steps

View File

@@ -4,11 +4,12 @@
inherit (lib) mkOption mkEnableOption types literalExpression;
in {
# Common agentsInput option used by all agent modules.
mkAgentsInputOption = description: mkOption {
type = types.nullOr types.anything;
default = null;
inherit description;
};
mkAgentsInputOption = description:
mkOption {
type = types.nullOr types.anything;
default = null;
inherit description;
};
# Common modelOverrides option.
mkModelOverridesOption = mkOption {
@@ -62,7 +63,7 @@ in {
{ src = inputs.skills-anthropic; selectSkills = [ "claude-api" ]; }
{ src = inputs.basecamp; }
]
'';
'';
};
# Helper to map externalSkills from module config to mkOpencodeSkills format.
@@ -71,5 +72,6 @@ in {
entry:
{inherit (entry) src skillsDir;}
// lib.optionalAttrs (entry.selectSkills != null) {inherit (entry) selectSkills;}
) cfgEntries;
)
cfgEntries;
}