2024-01-27 14:47:45 +01:00
|
|
|
{config, ...}: {
|
|
|
|
age.secrets."gitconfig-work".path = "${config.xdg.configHome}/git/gitconfig-work";
|
2023-05-18 15:10:28 +02:00
|
|
|
programs.git.includes = [
|
|
|
|
{
|
|
|
|
condition = "gitdir:~/Code/work/";
|
2024-01-27 14:47:45 +01:00
|
|
|
path = config.age.secrets."gitconfig-work".path;
|
2023-05-18 15:10:28 +02:00
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2023-01-31 09:38:11 +01:00
|
|
|
programs.git = {
|
|
|
|
enable = true;
|
|
|
|
userName = "winston";
|
|
|
|
userEmail = "hey@winston.sh";
|
|
|
|
|
|
|
|
signing = {
|
|
|
|
signByDefault = true;
|
|
|
|
key = "A476C39610E53A689A57BD0D0B89BC45007EE9CC";
|
|
|
|
};
|
|
|
|
|
|
|
|
diff-so-fancy.enable = true;
|
2023-02-20 20:52:04 +01:00
|
|
|
aliases = {
|
|
|
|
# get plain text diffs for patches
|
|
|
|
patch = "!git --no-pager diff --no-color";
|
|
|
|
# zip the current repo
|
|
|
|
gzip = "!git archive --format=tar.gz --output=$(basename $(git rev-parse --show-toplevel)).tar.gz $(git rev-parse --short HEAD)";
|
|
|
|
zip = "!git archive --format=zip --output=$(basename $(git rev-parse --show-toplevel)).zip $(git rev-parse --short HEAD)";
|
|
|
|
# for those 3am commits
|
2023-07-10 05:15:10 +02:00
|
|
|
yolo = "!git commit -m \"chore: $(curl -s https://whatthecommit.com/index.txt)\"";
|
2023-02-20 20:52:04 +01:00
|
|
|
};
|
|
|
|
|
2023-01-31 09:38:11 +01:00
|
|
|
lfs.enable = true;
|
|
|
|
|
|
|
|
ignores = [
|
|
|
|
# general
|
|
|
|
"*.log"
|
|
|
|
".DS_Store"
|
|
|
|
# editors
|
|
|
|
"*.swp"
|
|
|
|
".gonvim/"
|
|
|
|
".idea/"
|
|
|
|
"ltex.dictionary*.txt"
|
2023-12-19 17:55:23 +01:00
|
|
|
"ltex.disabledRules.*.txt"
|
2023-01-31 09:38:11 +01:00
|
|
|
# nix-specific
|
|
|
|
".direnv/"
|
|
|
|
".envrc"
|
|
|
|
];
|
|
|
|
|
|
|
|
extraConfig = {
|
|
|
|
credential.helper = "gopass";
|
|
|
|
init.defaultBranch = "main";
|
|
|
|
push.default = "current";
|
|
|
|
push.gpgSign = "if-asked";
|
|
|
|
rebase.autosquash = true;
|
2023-06-22 13:02:27 +02:00
|
|
|
url = {
|
2023-07-10 05:15:10 +02:00
|
|
|
"https://github.com/".insteadOf = "gh:";
|
|
|
|
"https://github.com/catppuccin/".insteadOf = "ctp:";
|
|
|
|
"https://github.com/nekowinston/".insteadOf = "winston:";
|
|
|
|
"https://gitlab.com/".insteadOf = "gl:";
|
2023-06-22 13:02:27 +02:00
|
|
|
};
|
2023-01-31 09:38:11 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|