dotfiles/home/apps/git.nix

73 lines
1.8 KiB
Nix
Raw Normal View History

2024-02-06 11:28:27 +01:00
{
config,
pkgs,
...
}: {
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
}
2024-04-16 01:16:52 +02:00
{
condition = "gitdir:~/Code/freelance/";
path = config.age.secrets."gitconfig-freelance".path;
}
2023-05-18 15:10:28 +02:00
];
2024-02-06 11:28:27 +01:00
# use fsmonitor
home.packages = [pkgs.rs-git-fsmonitor pkgs.watchman];
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
};
lfs.enable = true;
ignores = [
# general
"*.log"
".DS_Store"
# editors
"*.swp"
".gonvim/"
".idea/"
2024-05-01 21:00:27 +02:00
"ltex.*.txt"
# nix-specific
".direnv/"
".envrc"
];
extraConfig = {
2024-02-11 20:12:32 +01:00
core.fsmonitor = "rs-git-fsmonitor";
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
};
};
};
}