1
0
Fork 0
This repository has been archived on 2024-01-18. You can view files and clone it, but cannot push or open issues/pull-requests.
dotnix-archive/apps/git.nix

62 lines
1.4 KiB
Nix

{config, ...}: let
key = "0xB853ADA5DA7BBF7A";
insteadOf = prefix: domain: {
"https://${domain}/".insteadOf = "${prefix}:";
"git@${domain}:".insteadOf = "ssh:${prefix}:";
};
in {
programs.git = {
enable = true;
userName = "jolheiser";
userEmail = "john.olheiser@gmail.com";
signing = {
signByDefault = true;
key = key;
};
aliases = {
wt = "worktree";
ci = "commit -s -S -m";
br = "branch";
aa = "add .";
adog = "log --all --decorate --oneline --graph";
poh = "push origin HEAD";
cb = "checkout -b";
fu = "fetch upstream";
fo = "fetch origin";
dh = "diff HEAD";
};
lfs.enable = true;
ignores = [".idea/"];
extraConfig = {
init.defaultBranch = "main";
merge.conflictstyle = "diff3";
diff.colorMoved = "default";
core.editor = "hx";
push = {
default = "current";
gpgSign = "if-asked";
};
url =
insteadOf "gh" "github.com"
// insteadOf "jojo" "git.jojodev.com"
// insteadOf "tea" "gitea.com";
};
delta = {
enable = true;
options = {
features = "ctp-mocha";
navigate = true;
light = false;
line-numbers = true;
side-by-side = true;
};
};
includes = [
{
condition = "gitdir:~/ndlegis/";
path = "${config.xdg.configHome}/git/work-config";
}
];
};
}