[PR #51] fix: set force=true on config home.file to prevent clobber errors #53

Open
opened 2026-02-15 17:04:43 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/openclaw/nix-openclaw/pull/51
Author: @ioitiki
Created: 2/8/2026
Status: 🔄 Open

Base: mainHead: fix/config-file-force-nix-mode


📝 Commits (3)

  • 9a33d71 fix: set force=true on config home.file to prevent clobber errors
  • ceec748 Merge branch 'openclaw:main' into fix/config-file-force-nix-mode
  • 094ca85 Merge branch 'openclaw:main' into fix/config-file-force-nix-mode

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 nix/modules/home-manager/openclaw/config.nix (+1 -1)

📄 Description

Summary

  • Set force = true on the home.file entry for openclaw.json so home-manager overwrites it unconditionally
  • Fixes home-manager switch failing with "Existing file would be clobbered" after the gateway replaces the nix store symlink with a regular file

Root cause

The gateway's applyPluginAutoEnable runs on startup and calls writeConfigFile() even when OPENCLAW_NIX_MODE=1 is set. This replaces the read-only nix store symlink with a regular file. On the next home-manager switch, the checkLinkTargets step fails because it refuses to overwrite an unmanaged regular file.

The isNixMode guard exists for legacy config migration but is missing from the plugin auto-enable code path. This PR works around that by telling home-manager it's safe to overwrite.

Test plan

  • Verified existing checks (openclaw-config-validity, openclaw-hm-activation) are unaffected — they access .text, not force
  • Run home-manager switch after gateway has replaced the symlink — should succeed without -b backup

Fixes #50

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/openclaw/nix-openclaw/pull/51 **Author:** [@ioitiki](https://github.com/ioitiki) **Created:** 2/8/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/config-file-force-nix-mode` --- ### 📝 Commits (3) - [`9a33d71`](https://github.com/openclaw/nix-openclaw/commit/9a33d71ff5a63a1ad7f26585f80a294002ebfce7) fix: set force=true on config home.file to prevent clobber errors - [`ceec748`](https://github.com/openclaw/nix-openclaw/commit/ceec74822048fc4bc2613ee9b21c96c2bd45800c) Merge branch 'openclaw:main' into fix/config-file-force-nix-mode - [`094ca85`](https://github.com/openclaw/nix-openclaw/commit/094ca85398bab21cfd266a7cc9bf2e9fb21917fa) Merge branch 'openclaw:main' into fix/config-file-force-nix-mode ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `nix/modules/home-manager/openclaw/config.nix` (+1 -1) </details> ### 📄 Description ## Summary - Set `force = true` on the `home.file` entry for `openclaw.json` so home-manager overwrites it unconditionally - Fixes `home-manager switch` failing with "Existing file would be clobbered" after the gateway replaces the nix store symlink with a regular file ## Root cause The gateway's `applyPluginAutoEnable` runs on startup and calls `writeConfigFile()` even when `OPENCLAW_NIX_MODE=1` is set. This replaces the read-only nix store symlink with a regular file. On the next `home-manager switch`, the `checkLinkTargets` step fails because it refuses to overwrite an unmanaged regular file. The `isNixMode` guard exists for legacy config migration but is missing from the plugin auto-enable code path. This PR works around that by telling home-manager it's safe to overwrite. ## Test plan - [x] Verified existing checks (`openclaw-config-validity`, `openclaw-hm-activation`) are unaffected — they access `.text`, not `force` - [ ] Run `home-manager switch` after gateway has replaced the symlink — should succeed without `-b backup` Fixes #50 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 17:04:43 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: openclaw/nix-openclaw#53