nixos-config/home-manager/modules/git.nix
2025-04-02 21:34:02 +02:00

89 lines
1.7 KiB
Nix

{ pkgs, ... }:
{
programs.git = {
enable = true;
package = pkgs.gitSVN;
ignores = [
".vscode"
"*.sql"
"*.sql.gz"
"*.sql.zst"
".direnv/"
".venv/"
];
userName = "fleaz";
userEmail = "mail@felixbreidenstein.de";
signing = {
key = "9166FF9DFC1F4637";
signByDefault = true;
};
extraConfig = {
"branch" = {
sort = "-committerdate";
};
"column" = {
ui = "auto";
};
"commit" = {
verbose = "true";
};
"diff" = {
algorithm = "histogram";
colorMoved = "plain";
mnemonicPrefix = "true";
renames = "true";
};
"tag" = {
sort = "version:refname";
};
"help" = {
autocorrect = "prompt";
};
"core" = {
pager = "less -F -X";
};
"init" = {
defaultBranch = "main";
};
"pull" = {
rebase = "true";
};
"rebase" = {
autoSquash = "true";
autoStash = "true";
updateRefs = "true";
};
"fetch" = {
all = "true";
prune = "true";
pruneTags = "true";
};
"push" = {
autoSetupRemote = "true";
default = "simple";
followTags = "true";
};
};
aliases = {
# checkout-pull-request from GitHub
cpr = "!f() { git fetch origin refs/pull/$1/head && git checkout FETCH_HEAD; }; f";
};
includes = [
{
condition = "gitdir:~/denic/";
contents = {
user = {
email = "breidenstein@denic.de";
name = "Felix Breidenstein";
};
commit = {
gpgSign = false;
};
};
}
];
};
}