mirror of
https://github.com/openclaw/nix-openclaw.git
synced 2026-07-24 21:25:23 -04:00
Plugin auto-enable writes to config file in Nix mode #25
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Originally created by @ioitiki on GitHub (Feb 8, 2026).
Bug
When running the gateway with
OPENCLAW_NIX_MODE=1(set by the home-manager module), theapplyPluginAutoEnablecode path on gateway startup writes toopenclaw.jsonunconditionally — replacing the read-only nix store symlink with a regular file.Expected behavior
In Nix mode, the config file is managed declaratively and should not be written to at runtime. The legacy config migration already has an
isNixModeguard:But the plugin auto-enable path does not:
Impact
On every gateway startup, the symlink
~/.openclaw/openclaw.json → /nix/store/...gets replaced with a regular file. This causeshome-manager switchto fail on subsequent runs with:Workaround: setting
home.file.".openclaw/openclaw.json".force = truein the home-manager config.Suggested fix
Guard the
writeConfigFilecall in the auto-enable path with anisNixModecheck, consistent with the legacy migration path. In Nix mode, plugins should be declared in the Nix config rather than auto-enabled at runtime.Environment
nix-openclawhome-manager module