nix: stop wrappers from owning user config#1919
Draft
johnrichardrinehart wants to merge 1 commit into
Draft
Conversation
The Nix wrappers create ~/.git-ai/config.json whenever it is absent, while the Home Manager module manages the same path as a store symlink. A Git command between link cleanup and activation leaves a regular file that makes Home Manager abort rather than clobber it. Pass the Nix store Git path through the environment instead of writing user config. Let Home Manager force the one-time takeover of files left by older wrappers, and check that both wrappers run without creating config.
johnrichardrinehart
marked this pull request as draft
July 21, 2026 01:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is draft until I have time to review alternative approaches
The Nix wrappers and Home Manager module both own
~/.git-ai/config.json. If Git runs after the managed link is removed, the wrapper creates a regular file and the next Home Manager activation fails rather than clobber it.Pass the Nix store Git path through
GIT_AI_GIT_PATHinstead of writing user config. Mark the Home Manager file as forced so it can take over files left by older releases.The new flake check runs both wrappers with an isolated home and verifies that they do not create
config.json.