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.
26 lines
636 B
Nix
26 lines
636 B
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
# git for the primary user, configured through home-manager.
|
|
let
|
|
cfg = config.modules.git;
|
|
user = config.user.name;
|
|
in
|
|
{
|
|
options.modules.git.enable =
|
|
lib.mkEnableOption "git for the primary user, carrying the operator's commit identity";
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
home-manager.users.${user}.programs.git = {
|
|
enable = true;
|
|
|
|
# Git will not guess a name and address from the login and hostname.
|
|
# Without these a commit fails outright with `Author identity unknown`.
|
|
settings.user.name = "alexion";
|
|
settings.user.email = "contact@alexion.dev";
|
|
};
|
|
};
|
|
}
|