# Git identity and defaults. The name and email come from my.user so the # identity is defined once, in the host file. { config, lib, pkgs, osConfig, ... }: let cfg = config.my.home.git; in { options.my.home.git.enable = lib.mkEnableOption "Git and GitHub CLI configuration"; config = lib.mkIf cfg.enable { programs = { git = { enable = true; settings = { user = { name = osConfig.my.user.fullName; inherit (osConfig.my.user) email; }; init.defaultBranch = "main"; pull.rebase = true; push.autoSetupRemote = true; rebase.autoStash = true; merge.conflictStyle = "zdiff3"; diff.colorMoved = "default"; }; ignores = [ ".direnv/" "result" "result-*" ".DS_Store" ]; }; # Syntax-highlighted diffs as the git pager. delta = { enable = true; enableGitIntegration = true; options = { navigate = true; line-numbers = true; }; }; gh = { enable = true; settings.git_protocol = "ssh"; }; }; }; }