50 lines
1.0 KiB
Nix
50 lines
1.0 KiB
Nix
# Git configuration - unified from common.nix and development.nix
|
|
{
|
|
inputs,
|
|
lib,
|
|
config,
|
|
pkgs,
|
|
...
|
|
}: {
|
|
programs.git = {
|
|
enable = true;
|
|
package = pkgs.gitAndTools.gitFull;
|
|
userName = "Wong Ding Feng";
|
|
userEmail = "dingfengwong@gmail.com";
|
|
|
|
extraConfig = {
|
|
# From common.nix
|
|
init.defaultBranch = "main";
|
|
pull.rebase = true;
|
|
push.autoSetupRemote = true;
|
|
|
|
# From development.nix
|
|
core.editor = "vim";
|
|
merge.conflictstyle = "diff3";
|
|
diff.algorithm = "histogram";
|
|
};
|
|
|
|
# Git aliases
|
|
aliases = {
|
|
st = "status";
|
|
co = "checkout";
|
|
br = "branch";
|
|
ci = "commit";
|
|
unstage = "reset HEAD --";
|
|
last = "log -1 HEAD";
|
|
lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
|
|
};
|
|
};
|
|
|
|
# GitHub CLI configuration
|
|
programs.gh = {
|
|
enable = true;
|
|
settings = {
|
|
git_protocol = "ssh";
|
|
prompt = "enabled";
|
|
};
|
|
};
|
|
|
|
}
|
|
|