Harden and tune opencode configuration for Paseo-only use #140

Closed
opened 2026-08-05 09:21:13 +01:00 by nimmo · 0 comments
Owner

Context

The opencode configuration in modules/profiles/ai-runtime.nix was at bare minimum — only server, provider, and mcp were set. opencode is never used directly; all model access is via Paseo agents. This change hardens the config and adds quality-of-life features tuned for that Paseo-only workflow.

Scope

Tier 1 — Security/correctness

  • autoupdate = false — opencode is Nix-managed; prevents silent binary swaps mid-Paseo-agent-run
  • share = "disabled" — Paseo sessions contain SOPS paths and host inventory; no URL sharing
  • permission rules — enforces AGENTS.md constraints (no sudo except nixos-rebuild, no .env reads, no secrets edits, doom_loop/external_directory ask)

Tier 2 — Workflow quality

  • small_model = "ollama-lyra/qwen3:8b" — routes hidden title/summary system agents to lyra's idle 4070 instead of burning OpenRouter credits
  • enabled_providers — locks to openrouter + 3 ollama instances; prevents accidental provider discovery
  • instructions = ["README.md"] — supplements auto-discovered AGENTS.md with repo architecture/host inventory
  • ollama-lyra provider — exposes qwen3:8b, gemma4:12b, gemma4:e2b from lyra's RTX 4070 (192.168.8.146:11434)

Tier 3 — Power features

  • lsp = true — enables nixd (.nix), pyright (.py), gopls (.go), bash-language-server (.sh), typescript (.ts/.js)
  • formatter = true — enables nixfmt (.nix), ruff (.py), shfmt (.sh), gofmt (.go)
  • watcher.ignore — excludes result/, .git/, potential/** from file indexing
  • LSP and formatter binaries added to environment.systemPackages (all hosts), home.packages (desktop), and paseoRuntimePath

Cleanup

  • Removed legacy justfiles/opencode.just (opencode-web and opencode-share recipes) and its import from Justfile

Validation

  • nix flake check passes on all 5 hosts (electra, lena, vega, lyra, cosmos)
  • Deployed to electra via just test; opencode models confirms ollama-lyra/qwen3:8b, ollama-lyra/gemma4:12b, ollama-lyra/gemma4:e2b are available
  • Config file verified on disk: enabled_providers, small_model, ollama-lyra provider, lsp, formatter, watcher.ignore all present
  • Paseo daemon restart to surface new models in provider snapshot (deferred — requires killing running agents)
## Context The opencode configuration in `modules/profiles/ai-runtime.nix` was at bare minimum — only `server`, `provider`, and `mcp` were set. opencode is never used directly; all model access is via Paseo agents. This change hardens the config and adds quality-of-life features tuned for that Paseo-only workflow. ## Scope ### Tier 1 — Security/correctness - [x] `autoupdate = false` — opencode is Nix-managed; prevents silent binary swaps mid-Paseo-agent-run - [x] `share = "disabled"` — Paseo sessions contain SOPS paths and host inventory; no URL sharing - [x] `permission` rules — enforces AGENTS.md constraints (no sudo except nixos-rebuild, no .env reads, no secrets edits, doom_loop/external_directory ask) ### Tier 2 — Workflow quality - [x] `small_model = "ollama-lyra/qwen3:8b"` — routes hidden title/summary system agents to lyra's idle 4070 instead of burning OpenRouter credits - [x] `enabled_providers` — locks to openrouter + 3 ollama instances; prevents accidental provider discovery - [x] `instructions = ["README.md"]` — supplements auto-discovered AGENTS.md with repo architecture/host inventory - [x] `ollama-lyra` provider — exposes qwen3:8b, gemma4:12b, gemma4:e2b from lyra's RTX 4070 (192.168.8.146:11434) ### Tier 3 — Power features - [x] `lsp = true` — enables nixd (.nix), pyright (.py), gopls (.go), bash-language-server (.sh), typescript (.ts/.js) - [x] `formatter = true` — enables nixfmt (.nix), ruff (.py), shfmt (.sh), gofmt (.go) - [x] `watcher.ignore` — excludes result/**, .git/**, potential/** from file indexing - [x] LSP and formatter binaries added to `environment.systemPackages` (all hosts), `home.packages` (desktop), and `paseoRuntimePath` ### Cleanup - [x] Removed legacy `justfiles/opencode.just` (`opencode-web` and `opencode-share` recipes) and its import from `Justfile` ## Validation - [x] `nix flake check` passes on all 5 hosts (electra, lena, vega, lyra, cosmos) - [x] Deployed to electra via `just test`; `opencode models` confirms ollama-lyra/qwen3:8b, ollama-lyra/gemma4:12b, ollama-lyra/gemma4:e2b are available - [x] Config file verified on disk: `enabled_providers`, `small_model`, `ollama-lyra` provider, `lsp`, `formatter`, `watcher.ignore` all present - [ ] Paseo daemon restart to surface new models in provider snapshot (deferred — requires killing running agents)
nimmo closed this issue 2026-08-05 11:01:42 +01:00
Sign in to join this conversation.
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nimmo/nixos-config#140
No description provided.