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/nogui/git.nix

75 lines
1.8 KiB
Nix
Raw Permalink Normal View History

{config, ...}: let
key = "0xB853ADA5DA7BBF7A";
insteadOf = prefix: domain: {
"https://${domain}/".insteadOf = "${prefix}:";
"git@${domain}:".insteadOf = "ssh:${prefix}:";
};
2023-06-28 20:48:01 +00:00
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";
unstage = "restore --staged";
last = "log --show-signature --format=fuller --max-count=1 HEAD";
2023-08-07 17:33:41 +00:00
tui = "!lazygit";
2023-06-28 20:48:01 +00:00
};
lfs.enable = true;
ignores = [".idea/" "result"];
2023-06-28 20:48:01 +00:00
extraConfig = {
init.defaultBranch = "main";
merge.conflictstyle = "diff3";
diff.colorMoved = "default";
core.editor = "hx";
push = {
sutoSetupRemote = true;
default = "current";
gpgSign = "if-asked";
};
pull.rebase = true;
url =
{
"ugit@git.jolheiser.com:".insteadOf = "ssh:jo:";
}
// insteadOf "gh" "github.com"
// insteadOf "jj" "git.jojodev.com"
// insteadOf "gt" "gitea.com"
// insteadOf "gl" "gitlab.com"
// insteadOf "cb" "codeberg.org";
2023-06-28 20:48:01 +00:00
};
delta = {
enable = true;
options = {
features = "ctp-mocha";
navigate = true;
light = false;
line-numbers = true;
side-by-side = true;
};
};
includes = [
{
path = "/run/agenix/git-send-email";
}
{
condition = "gitdir:~/ndlegis/";
path = "${config.xdg.configHome}/git/work-config";
}
];
2023-06-28 20:48:01 +00:00
};
}