Files
NixOsConfig/modules/home/git.nix
T
Claude 7dd6853124 Normalize file modes to 644
All tracked files were committed as 755; only Nix reads them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JZ16yf4acmaSiHq81vyQ6Z
2026-10-12 20:41:48 +00:00

59 lines
1.2 KiB
Nix

# 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";
};
};
};
}