flake/homes/modules/git.nix

122 lines
2.5 KiB
Nix
Executable file

{
config,
pkgs,
...
}: {
home.packages = with pkgs; [
delta # git diff viewer
];
programs = {
git = {
enable = true;
lfs.enable = true;
signing = {
key = "F68745A836CA0412";
format = "openpgp";
signByDefault = true;
};
settings = {
user.name = "_cry64";
user.email = "them@dobutterfliescry.net";
alias = {
s = "status";
d = "diff";
l = "log";
c = "commit";
p = "push";
};
color.ui = true;
core.editor = "hx";
github.user = "cry128";
# delta diff viewer
core.pager = "delta";
interactive.diffFilter = "delta --color-only";
delta = {
navigate = true;
line-numbers = true;
side-by-side = true;
};
merge.conflictStyle = "zdiff3";
init = {
defaultBranch = "main";
};
url = {
"git@github.com:" = {
insteadOf = [
"gh:"
"github:"
];
};
"https://gitlab.com/" = {
insteadOf = [
"gl:"
"gitlab:"
];
};
"git@codeberg.org:" = {
insteadOf = [
"cb:"
"codeberg:"
];
};
"git@tearforge.net/" = {
insteadOf = [
"cry:"
"forge:"
];
};
};
};
includes = [
{
path = "/home/me/agribit/.gitconfig";
condition = "gitdir:/home/me/agribit/**";
}
# {
# path = "/home/me/luminary/.gitconfig";
# condition = "gitdir:/home/me/luminary/**";
# }
];
};
lazygit = {
enable = true;
enableFishIntegration = true;
enableZshIntegration = true;
shellWrapperName = "lg";
settings = {
gui = {
useHunkModeInStagingView = false;
skipDiscardChangeWarning = false;
skipStashWarning = true;
animateExplosion = true; # FUCK YEAHHHHHHHHHHHHHHHHHHHHHHHHH
theme = {
lightTheme = false;
activeBorderColor = ["green" "bold"];
inactiveBorderColor = ["white"];
selectedLineBgColor = ["default"];
};
};
git.pagers = [
{
pager = "delta --dark --pager=never";
}
];
};
};
};
}