nixos/home/modules/git.nix

42 lines
1.0 KiB
Nix

{ ... }:
{
programs.git = {
enable = true;
userName = "Zynh Ludwig";
userEmail = "zynh0722@gmail.com";
ignores = [
"Session.vim"
];
aliases = {
co = "checkout";
ci = "commit";
st = "status";
br = "branch";
hist = "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short";
type = "cat-file -t";
dump = "cat-file -p";
graph = "log --graph --decorate --pretty=oneline --abbrev-commit";
};
extraConfig = {
init.defaultBranch = "main";
core = {
editor = "nvim";
autocrlf = "input";
safecrlf = true;
};
credential = {
helper = [
"cache --timeout 7200"
"oauth"
];
"https://git.zynh.me" = {
oauthClientId = "13d5b95d-565d-4264-8961-c45cc38eaa8a";
oauthScopes = "read_repository write_repository";
oauthAuthURL = "/login/oauth/authorize";
oauthTokenURL = "/login/oauth/access_token";
};
};
};
};
}