feat: bundle opencode plugin as open-code-review passthru + HM module
CI / check (push) Has been cancelled
CI / check (push) Has been cancelled
- packages/open-code-review/opencode-plugin.nix: builds the plugin TS file
plus runtime node_modules from the plugin's package-lock.json into
share/open-code-review/opencode (exposed as passthru.opencode-plugin,
same source rev as the CLI so versions stay locked)
- modules/open-code-review-hm.nix: homeManagerModules.default with
programs.open-code-review.{enable,opencode.enable} — symlinks the plugin
and node_modules into ~/.config/opencode/plugins/ and installs the CLI
- flake.nix: expose homeManagerModules.default
Note: upstream declares the plugin SDKs as devDependencies, so the
lockfile install must not use --omit=dev.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
@@ -116,6 +116,41 @@ nftablesbuilder.eu (served with a self-signed certificate, hence the
|
||||
`curlOpts = "-k"` in the derivation); the source repository is missing the
|
||||
`settings` crate, which this overlay patches in.
|
||||
|
||||
### OpenCodeReview OpenCode Plugin (Home Manager)
|
||||
|
||||
The `open-code-review` package bundles its OpenCode plugin (the plugin file
|
||||
plus runtime `node_modules`) as `passthru.opencode-plugin`, built from the
|
||||
same source revision as the CLI. A Home Manager module symlinks it into
|
||||
`~/.config/opencode/plugins/` and puts the `ocr` CLI on PATH:
|
||||
|
||||
```nix
|
||||
inputs.millerson-nix-overlay.url = "git+https://git.millerson.name/alex/millerson-overlay.nix.git";
|
||||
inputs.home-manager.url = "github:nix-community/home-manager";
|
||||
```
|
||||
|
||||
```nix
|
||||
# in your home-manager configuration
|
||||
imports = [ millerson-nix-overlay.homeManagerModules.default ];
|
||||
|
||||
programs.open-code-review = {
|
||||
enable = true;
|
||||
opencode.enable = true; # symlink plugin into ~/.config/opencode
|
||||
};
|
||||
```
|
||||
|
||||
Without Home Manager, symlink manually:
|
||||
|
||||
```bash
|
||||
plugin=$(nix build --print-out-paths \
|
||||
git+https://git.millerson.name/alex/millerson-overlay.nix.git#open-code-review.passthru.opencode-plugin)
|
||||
mkdir -p ~/.config/opencode/plugins
|
||||
ln -sf $plugin/share/open-code-review/opencode/open-code-review.ts ~/.config/opencode/plugins/
|
||||
ln -sfn $plugin/share/open-code-review/opencode/node_modules ~/.config/opencode/plugins/node_modules
|
||||
```
|
||||
|
||||
Note: the `node_modules` symlink is shared across everything in the plugins
|
||||
directory; other manually-installed plugins with conflicting npm dependencies
|
||||
cannot coexist with it.
|
||||
|
||||
## Development
|
||||
|
||||
|
||||
Reference in New Issue
Block a user