feat(git): declare the operator's commit identity (task 0015)

Git identity lived only in one checkout's local configuration on one
machine, so it was invisible to every other checkout and lost on a
reimage. Declare it as a module instead, enabled on neogaia.

It is a module rather than base plumbing so a host that should not carry
a personal commit identity can decline it.
This commit is contained in:
2026-07-20 10:53:47 -04:00
parent 0d685ce277
commit c9fc17ecf5
4 changed files with 54 additions and 8 deletions

View File

@@ -10,8 +10,26 @@ It is a `Module` rather than base plumbing because a `Host` that should not carr
## Acceptance criteria
- [ ] A git `Module` following the `Enable convention` exists and is enabled on `neogaia`
- [ ] The commit identity is configured through home-manager and matches the one used in existing history
- [ ] `nix flake check` builds the `neogaia` toplevel
- [ ] Manual confirmation: committing in a repository outside this checkout succeeds with no per-command identity override
- [ ] The stale note in the project's agent instructions claiming git identity is unconfigured is corrected, since commits already work here through repository-local configuration
- [x] A git `Module` following the `Enable convention` exists and is enabled on `neogaia`
- [x] The commit identity is configured through home-manager and matches the one used in existing history
- [x] `nix flake check` builds the `neogaia` toplevel
- [x] Manual confirmation: committing in a repository outside this checkout succeeds with no per-command identity override
- [x] The stale note in the project's agent instructions claiming git identity is unconfigured is corrected, since commits already work here through repository-local configuration
## Implementation Notes
`programs.git.userName`/`userEmail` are renamed in this home-manager pin and emit an obsolete-option trace.
The module uses `settings.user.name`/`settings.user.email`.
Do not "fix" it back.
The commit name is the literal `"alexion"` rather than `config.user.name`, which review raised as duplication.
A Unix login and a commit display name are separate concepts that merely coincide here, so binding them would let a host overriding its login silently rewrite the operator's commit identity.
The manual confirmation was met against the built configuration, not the running machine: `nixos-rebuild switch` needs sudo and has not run, so `~/.config/git/config` does not yet exist on `neogaia`.
The generated gitconfig was built from the `neogaia` toplevel and a commit driven under `env -i` with a scratch `HOME`, producing `alexion <contact@alexion.dev>` with no per-command override.
This proves the derivation rather than the deployment, and the live check remains owed at the next rebuild.
Review surfaced an unanticipated hazard that proved harmless.
Home-manager writes `~/.config/git/config`, while an undeclared `~/.gitconfig` also exists and outranks it per key.
It holds only a `tea` credential helper and no `user.*`, so it does not shadow the identity, confirmed by re-running the commit test with both files present.
Declaring that credential helper is a reasonable follow-up, since it will not survive a reimage.