feat(git): declare the operator's commit identity (task 0015) #8
@@ -22,9 +22,9 @@ It is a `Module` rather than base plumbing because a `Host` that should not carr
|
|||||||
The module uses `settings.user.name`/`settings.user.email`.
|
The module uses `settings.user.name`/`settings.user.email`.
|
||||||
Do not "fix" it back.
|
Do not "fix" it back.
|
||||||
|
|
||||||
Review on the pull request asked for the module on every host, so `enable` defaults to true rather than being restated per host, and the explicit line in `hosts/neogaia/default.nix` is gone as redundant.
|
Review on the pull request asked for the module on every host, which was first built by defaulting `enable` to true and dropping the per-host line.
|
||||||
Defaulting the option keeps the opt-out this task's rationale asked for, where moving the identity into the shared base config would not.
|
The operator then chose the opposite: `enable` defaults to false and each host enables it explicitly, so a host keeps reading as a full checklist of what it carries rather than hiding a default-on module.
|
||||||
The `neogaia` toplevel hashes identically before and after the change.
|
Enabling it is therefore a step when adding a host.
|
||||||
|
|
||||||
The commit name is the literal `"alexion"` rather than `config.user.name`, which review raised as duplication.
|
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.
|
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.
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ The domain model (Host, Module, Skeleton, Auto-loader, Enable convention, overla
|
|||||||
Both were true only while the machine still ran CachyOS against a distro Nix daemon.
|
Both were true only while the machine still ran CachyOS against a distro Nix daemon.
|
||||||
- The substituters a `nix build` fetches from are the **daemon's** (`/etc/nix/nix.conf`), *not* the `nix.settings` of the config being built — those only govern the built system.
|
- The substituters a `nix build` fetches from are the **daemon's** (`/etc/nix/nix.conf`), *not* the `nix.settings` of the config being built — those only govern the built system.
|
||||||
The two coincide here because the dev host runs this flake; they diverge on any machine that does not.
|
The two coincide here because the dev host runs this flake; they diverge on any machine that does not.
|
||||||
- Git identity is declared in the flake by `modules/git.nix`, which writes `alexion <contact@alexion.dev>` — the identity all history uses.
|
- Git identity is declared in the flake by `modules/git.nix`, which writes `alexion <contact@alexion.dev>` — the identity all history uses — on any host enabling `modules.git`.
|
||||||
It is one of the few modules defaulting to on, so a host carries it without restating it and declines by setting `modules.git.enable = false`.
|
Every new host has to enable it, so that a host reads as a full checklist of what it carries.
|
||||||
Once such a host has been rebuilt, a checkout on it needs no hand-written identity and keeps one across a reimage.
|
Once such a host has been rebuilt, a checkout on it needs no hand-written identity and keeps one across a reimage.
|
||||||
Two things mask a broken module, so neither is evidence it works: this checkout's `.git/config` carries the same identity, and home-manager writes `~/.config/git/config` while a `~/.gitconfig` also exists and outranks it per key.
|
Two things mask a broken module, so neither is evidence it works: this checkout's `.git/config` carries the same identity, and home-manager writes `~/.config/git/config` while a `~/.gitconfig` also exists and outranks it per key.
|
||||||
That `~/.gitconfig` holds only a `tea` credential helper and no `user.*`, so it does not shadow the identity today, but it is undeclared and will not survive a reimage.
|
That `~/.gitconfig` holds only a `tea` credential helper and no `user.*`, so it does not shadow the identity today, but it is undeclared and will not survive a reimage.
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
modules.fish.enable = true;
|
modules.fish.enable = true;
|
||||||
modules.fish.defaultShell = true;
|
modules.fish.defaultShell = true;
|
||||||
|
|
||||||
|
modules.git.enable = true;
|
||||||
modules.tmux.enable = true;
|
modules.tmux.enable = true;
|
||||||
modules.nvim.enable = true;
|
modules.nvim.enable = true;
|
||||||
modules.claude-code.enable = true;
|
modules.claude-code.enable = true;
|
||||||
|
|||||||
@@ -9,17 +9,8 @@ let
|
|||||||
user = config.user.name;
|
user = config.user.name;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.modules.git.enable = lib.mkOption {
|
options.modules.git.enable =
|
||||||
type = lib.types.bool;
|
lib.mkEnableOption "git for the primary user, carrying the operator's commit identity";
|
||||||
default = true;
|
|
||||||
description = ''
|
|
||||||
Whether to configure git for the primary user, carrying the operator's
|
|
||||||
commit identity.
|
|
||||||
|
|
||||||
On by default, so every host can commit without restating it. A host that
|
|
||||||
should not carry a personal commit identity sets this to false.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
home-manager.users.${user}.programs.git = {
|
home-manager.users.${user}.programs.git = {
|
||||||
|
|||||||
Reference in New Issue
Block a user