Skip to content

feat: opencode.installPackage toggle and OpenCode README section#2

Merged
cooper (czxtm) merged 1 commit into
mainfrom
feat/agent-skills-opencode-toggle
May 16, 2026
Merged

feat: opencode.installPackage toggle and OpenCode README section#2
cooper (czxtm) merged 1 commit into
mainfrom
feat/agent-skills-opencode-toggle

Conversation

@czxtm
Copy link
Copy Markdown
Contributor

Summary

  • Adds darkmatter.agentSkills.opencode.installPackage (default true). When false, skips Home Manager's pkgs.opencode install — useful when opencode is managed via Homebrew or another channel. Config files and skills are still installed either way.
  • Drops targets.opencode.enable = true from the registry-skills example and adds a dedicated OpenCode subsection explaining how skills land there and what the current limitation is.

Why the stub package

Setting programs.opencode.package = null directly crashes the upstream HM warnings block — it calls lib.versionAtLeast on a null version (see agents PR #3 for context). Until upstream is fixed, the toggle substitutes an empty stub derivation with a version attr to satisfy lib.getVersion without putting an opencode binary on PATH.

Pairs with

  • darkmatter/skills#3 (the agents-repo refactor switching to canonical programs.opencode.*). Once that merges, run nix flake update darkmatter-agents here to pick up the EACCES fix; this PR is independent and can land first or second.

Test plan

  • nix eval confirms programs.opencode.package.name == "opencode-1.14.48" when installPackage = true.
  • nix eval confirms programs.opencode.package.name == "opencode-stub" (version 1.2.15) when installPackage = false.
  • OpenCode config files (opencode/opencode.json) and skill entries still present in both modes.
  • Apply via home-manager switch on a host that uses darkmatter.agentSkills.opencode.installPackage = false and confirm no conflict with a brew-installed opencode.

🤖 Generated with Claude Code

Adds `darkmatter.agentSkills.opencode.installPackage` (default true)
so consumers managing the opencode binary outside Home Manager
(Homebrew, manual install) can skip HM's `pkgs.opencode` add to
`home.packages`. When false, a tiny stub derivation is substituted
into `programs.opencode.package` — required because setting it to
null currently crashes the upstream HM warnings block (calls
`lib.versionAtLeast` on a null version).

README updates:
- Drop `targets.opencode.enable = true` from the registry-skills
  example. The darkmatter preset now installs OpenCode skills via
  `programs.opencode.skills`, and enabling the agent-skills opencode
  target would overlap with the preset's per-skill entries.
- New OpenCode subsection documenting how skills land in OpenCode,
  the known third-party-source limitation, and the installPackage
  toggle.

Lock bump for `darkmatter-agents` follows once the upstream PR lands.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@czxtm cooper (czxtm) merged commit 0b674eb into main May 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant