dotnix/apps/nogui/git.nix

75 lines
2.0 KiB
Nix
Raw Permalink Normal View History

{ pkgs, config, ... }:
let
insteadOf = prefix: domain: {
"https://${domain}/".insteadOf = "${prefix}:";
"git@${domain}:".insteadOf = "ssh:${prefix}:";
};
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAUxLwkJOlalAHTdkbh+m49XTZGKDqWz1o/o8OLmtQdX";
sshSigning = {
user.signingkey = key;
commit.gpgSign = true;
tag.gpgSign = true;
gpg = {
format = "ssh";
ssh.allowedSignersFile = "${pkgs.writeText "allowedSigners" "git@jolheiser.com ${key}"}";
};
};
in
{
2023-06-28 20:48:01 +00:00
programs.git = {
enable = true;
userName = "jolheiser";
userEmail = "git@jolheiser.com";
2023-06-28 20:48:01 +00:00
aliases = {
wt = "worktree";
ci = "commit -s -S -m";
ca = "commit --amend";
pf = "push --force";
2023-06-28 20:48:01 +00:00
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"
"node_modules"
"ve"
];
extraConfig = {
init.defaultBranch = "main";
merge.conflictstyle = "zdiff3";
diff.colorMoved = "default";
core.editor = "hx";
push = {
sutoSetupRemote = true;
default = "current";
gpgSign = "if-asked";
};
rerere.enabled = true;
pull.rebase = true;
diff.algorithm = "histogram";
merge.tool = "hx";
url =
insteadOf "jo" "git.jolheiser.com"
// insteadOf "gh" "github.com"
// insteadOf "jj" "git.jojodev.com"
// insteadOf "gt" "gitea.com"
// insteadOf "gl" "gitlab.com"
// insteadOf "cb" "codeberg.org";
} // sshSigning;
difftastic = {
2023-06-28 20:48:01 +00:00
enable = true;
};
includes = [ { inherit (config.age.secrets.git-send-email) path; } ];
2023-06-28 20:48:01 +00:00
};
}