Harden and tune opencode configuration for Paseo-only use #141
No reviewers
Labels
No labels
area:authentication
area:flake-utilities
area:performance
area:tbd
host:chaos
host:electra
host:fleet
host:lyra
host:nova
host:vega
investigation
phase:cutover
phase:deploy
phase:mcp
phase:module
phase:packaging
phase:prep
phase:validation
priority:high
priority:medium
project:attic-postgres-lyra-rollout
project:auto-update-reliability
project:auto-update-remediation
project:declarative-purity-cleanup
project:external-review
project:fleet-boundary-cleanup
project:host-facts-refactor
project:lyra-nixos-deploy
project:lyra-service-stack-migration
project:nebula-mesh-network
project:nixos-build-deployment-pipeline
project:security-hardening
project:service-stack-migration
project:vega-sillytavern-cutover
project:wiki-rebuild
repo:numtide/flake-utils
repo:numtide/nix-auth
repo:numtide/nixos-passthru-cache
repo:numtide/nix-relay
service:auto-update
service:mem0
service:nix
service:sillytavern
service:slskd
service:synthseek
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
nimmo/nixos-config!141
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/harden-opencode-config"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #140
Automated code review
Reviewed commit:
3047c176c97f9d1859016dddee70f80da392aa7bVerdict: Ready to merge
No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory.
Overall assessment
The pull request hardens opencode configuration by disabling autoupdate and sharing, migrating provider URLs to nebula mesh DNS, and adding LSP/formatter tooling. It removes legacy sharing scripts from the Justfile. Two actionable findings remain regarding package scope duplication and systemd service readiness ordering.
Blocking findings
None.
Important findings
None.
Suggestions
Duplicate LSP/formatter packages in home.packages and environment.systemPackages (modules/profiles/ai-runtime.nix:134; high confidence)
The diff adds pkgs.nixd, pkgs.pyright, pkgs.gopls, pkgs.go, pkgs.ruff, and pkgs.shfmt to home.packages (lines ~134-142) and again to environment.systemPackages (lines ~395-401).
Impact: Unnecessary closure duplication across user and system scopes increases storage overhead without functional benefit if only the systemd service requires them.
Suggested fix: Remove the packages from home.packages if they are strictly required only by the opencode systemd service, or scope them to a dedicated derivation/service-specific PATH injection.
Systemd service lacks explicit nebula/network readiness dependency (modules/profiles/ai-runtime.nix:392; medium confidence)
systemd.services.opencode only declares wants = [ "sops-nix.service" ]; with no After= or Wants= directives for nebula or network-online.target.
Impact: Potential startup race condition if the nebula overlay initializes after opencode attempts to resolve .mesh URLs, causing connection failures on boot.
Suggested fix: Add After=nebula.service network-online.target and Wants=nebula.service to the systemd unit to enforce correct initialization order before the service starts.
Tests and validation
Questions
Review limitations
Diff coverage
Justfile: reviewed — included in a context-limited batchjustfiles/opencode.just: reviewed — included in a context-limited batchmodules/profiles/ai-runtime.nix: reviewed — included in a context-limited batchReview metadata
Review response
Verdict: Ready to merge — no blocking or important findings.
Suggestions addressed
home.packages.environment.systemPackagescovers the opencode systemd service on all hosts (including headless vega/lyra), andpaseoRuntimePathcovers the Paseo desktop wrapper.home.packageswas duplicating the closure unnecessarily.Suggestions rejected
Hardcoded LAN IP for ollama-lyra — All existing ollama providers (
ollama-novaat192.168.8.124,ollama-desktopat192.168.8.226) use hardcoded LAN IPs.ollama-lyraat192.168.8.146follows the same established pattern. Consistent with the existing codebase.System-wide package bloat on server hosts — vega and lyra import this profile via
ai-desktop.nixand run the opencode service withlsp = trueandformatter = true. The LSP/formatter packages are required on those hosts for the opencode service to provide language-server diagnostics and formatting. Not bloat — intentional.Validation
nix flake checkpasses on all 5 hosts after the follow-up commitopencode modelson electra confirmsollama-lyra/qwen3:8b,ollama-lyra/gemma4:12b,ollama-lyra/gemma4:e2bare availableReview response (commit
f7f784d)Important finding — rejected
permission.bashrules control whether opencode prompts the user for approval before running a command — they do not grant sudo access. No host in this fleet has passwordless sudo configured, sosudo nixos-rebuild switchwould prompt for a password that the agent cannot provide. The rule is effectively inert: it documents the AGENTS.md policy ("Cannot run commands requiring sudo except for nixos-rebuild commands") at the opencode approval layer, but cannot "grant privileged system rebuild capabilities" because sudo itself remains password-gated at the OS level. Removing the rule would be strictly worse — it would cause opencode to prompt for approval on everynixos-rebuildattempt, adding friction without any security benefit, since the command would still fail at the sudo password prompt.Suggestions
go, gopls cannot function.nova.meshandlyra.meshnebula overlay DNS names. ollama-desktop keeps its hardcoded192.168.8.226IP because that host does not join the mesh.Validation
nix flake checkpasses on all 5 hostscurl http://lyra.mesh:11434/api/tagsconfirmed reachable from electra via nebula overlayValidation complete. All review findings addressed. nix flake check passes on all 5 hosts. Mesh DNS confirmed for lyra.mesh and nova.mesh. PR is ready to merge.