init
This commit is contained in:
33
modules/home/git.nix
Normal file
33
modules/home/git.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{ host, ... }:
|
||||
let
|
||||
inherit (import ../../hosts/${host}/variables.nix) gitUsername gitEmail;
|
||||
in
|
||||
{
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "${gitUsername}";
|
||||
userEmail = "${gitEmail}";
|
||||
|
||||
extraConfig = {
|
||||
# FOSS-friendly settings
|
||||
push.default = "simple"; # Match modern push behavior
|
||||
credential.helper = "cache --timeout=7200";
|
||||
init.defaultBranch = "main"; # Set default new branches to 'main'
|
||||
log.decorate = "full"; # Show branch/tag info in git log
|
||||
log.date = "iso"; # ISO 8601 date format
|
||||
# Conflict resolution style for readable diffs
|
||||
merge.conflictStyle = "diff3";
|
||||
};
|
||||
# Optional: FOSS-friendly Git aliases
|
||||
aliases = {
|
||||
br = "branch --sort=-committerdate";
|
||||
co = "checkout";
|
||||
df = "diff";
|
||||
com = "commit -a";
|
||||
gs = "stash";
|
||||
gp = "pull";
|
||||
lg = "log --graph --pretty=format:'%Cred%h%Creset - %C(yellow)%d%Creset %s %C(green)(%cr)%C(bold blue) <%an>%Creset' --abbrev-commit";
|
||||
st = "status";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user