1
0
Fork 0
dotfiles/home/programs/git.nix
Daniel Kempkens 5ff0781b10
All checks were successful
Build / build-arm64-linux (push) Successful in 9m19s
Build / build-amd64-linux (push) Successful in 36m44s
git: use zdiff3
2023-11-07 12:36:04 +01:00

139 lines
2.4 KiB
Nix

{ pkgs, ... }:
{
home.packages = with pkgs; [
git-absorb
git-crypt
];
programs.git = {
enable = true;
lfs.enable = true;
difftastic = {
enable = true;
};
userName = "Daniel Kempkens";
userEmail = "daniel+git@kempkens.io";
aliases = {
lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative";
};
extraConfig = {
core = {
editor = "nvim";
whitespace = "trailing-space,space-before-tab";
autocrlf = "input";
};
pull = {
rebase = true;
};
push = {
default = "simple";
};
apply = {
whitespace = "fix";
};
merge = {
conflictStyle = "zdiff3";
};
rerere = {
enabled = true;
};
color = {
ui = "auto";
};
};
ignores = [
"*~"
"*.swp"
".direnv/"
".DS_Store"
];
includes = [
# Private
{
condition = "hasconfig:remote.*.url:forgejo@git.kempkens.io:*/**";
contents = {
user = {
signingKey = "~/.ssh/GitHub.pub";
};
commit = {
gpgSign = true;
};
tag = {
gpgSign = true;
};
gpg = {
format = "ssh";
};
};
}
{
condition = "hasconfig:remote.*.url:git@github.com:*/**";
contents = {
user = {
signingKey = "~/.ssh/GitHub.pub";
};
commit = {
gpgSign = true;
};
tag = {
gpgSign = true;
};
gpg = {
format = "ssh";
};
};
}
# Work
{
condition = "hasconfig:remote.*.url:git@git.app.nedeco.de:*/**";
contents = {
user = {
email = "d.kempkens@nedeco.de";
name = "Daniel Kempkens";
signingKey = "~/.ssh/nedeco_gitlab.pub";
};
commit = {
gpgSign = true;
};
tag = {
gpgSign = true;
};
gpg = {
format = "ssh";
};
"gpg \"ssh\"" = {
allowedSignersFile = "~/.ssh/allowed_signers/work-nedeco";
};
};
}
];
};
home.sessionVariables.GIT_CEILING_DIRECTORIES = "/Users";
}