Files
nix-dotfiles/users/alice/home/git.nix
ahuston-0 44eb4e2403
All checks were successful
Check flake.lock / Check health of `flake.lock` (pull_request) Successful in 17s
Check Nix flake / Perform Nix flake checks (pull_request) Successful in 3m48s
decouple hydra nix from flake nix
2025-12-07 17:35:43 -05:00

37 lines
1.3 KiB
Nix

{ ... }:
{
programs.git = {
enable = true;
lfs.enable = true;
signing = {
key = "5EFFB75F7C9B74EAA5C4637547940175096C1330";
signByDefault = true;
};
settings = {
push.autosetupremote = true;
pull.rebase = true;
color.ui = true;
init.defaultBranch = "main";
format.signoff = true;
pack.windowMemory = "2g";
pack.packSizeLimit = "1g";
user.email = "aliceghuston@gmail.com";
user.name = "ahuston-0";
alias = {
gone = ''
!git for-each-ref --format '%(refname:short) %(upstream)' | # dump all older branches
awk 'NF < 2 {print $1}' | # get nuked branches
grep -Pv "(^origin/|^origin$|stash)" | # filter out remotes & stash
sed 's/\\x27/\\x5C\\x27/' | # remove single quotes, for xargs reasons
xargs -r git branch -D # nuke the branches
# !git fetch -p && git for-each-ref --format '%(refname:short) %(upstream:track)' | # dump all branches
# awk '$2 == "[gone]" {print $1}' | # get nuked branches
# sed 's/\\x27/\\x5C\\x27/' | # remove single quotes, for xargs reasons
# xargs -r git branch -D; # nuke the branches #
'';
};
};
};
}