MyNixOS website logo
option

programs.opencode.mutableSettings

Whether to leave $XDG_CONFIG_HOME/opencode/opencode.json, $XDG_CONFIG_HOME/opencode/cli.json, and $XDG_CONFIG_HOME/opencode/tui.json writable by OpenCode.

When enabled, declarative settings, CLI settings, and TUI settings are written to $XDG_CONFIG_HOME/opencode/home-manager.json, $XDG_CONFIG_HOME/opencode/home-manager-cli.json, and $XDG_CONFIG_HOME/opencode/home-manager-tui.json. Declarative settings and TUI settings are loaded through OPENCODE_CONFIG and OPENCODE_TUI_CONFIG. CLI settings are loaded through OPENCODE_CLI_CONFIG_CONTENT because OpenCode 2 does not provide a path selector for cli.json; the generated home-manager-cli.json layer contains the same content for inspection and validation. Declarative settings override global user settings; project settings can still override them. OPENCODE_TUI_CONFIG requires OpenCode 1.2.15 or later and is ignored by OpenCode 2. OPENCODE_CLI_CONFIG_CONTENT requires OpenCode 2.

These variables are set through home.sessionVariables and must reach OpenCode launches outside the web service for declarative settings to be loaded. The web service receives them automatically.

Disabling this option restores Home Manager management of the main files. If OpenCode has created those files, activation reports the normal file collision; back up or move the app-owned files before switching back. OpenCode can also create $XDG_CONFIG_HOME/opencode/opencode.jsonc, which takes precedence over the managed opencode.json without causing a collision. Back up and move that file, or reconcile its contents with your declarations, before disabling this option.

Declarations
Type
boolean
Default
false
Example
true