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:
25
modules/git.nix
Normal file
25
modules/git.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
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";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user