nix-config/home/git.nix

70 lines
1.5 KiB
Nix

{ pkgs, ... }:
{
programs.git = {
enable = true;
# Git LFS support
lfs.enable = true;
settings = {
user = {
name = "mikl";
email = "mikl@iscg.dev";
};
init.defaultBranch = "main";
# Always rebase on pull
pull.rebase = true;
# GPG signing (used by pass)
gpg = {
format = "openpgp";
program = "${pkgs.gnupg}/bin/gpg";
};
# Better diff algorithm (longer but faster on large files)
diff.algorithm = "histogram";
# Use osxkeychain for forgejo and other HTTPS remotes
credential.helper = "osxkeychain";
"credential.https://git.iscg.dev.helper" = "osxkeychain";
# Color output
color.ui = "auto";
color.diff = "auto";
color.status = "auto";
color.branch = "auto";
# Useful aliases (in addition to shell aliases)
alias.st = "status";
alias.co = "checkout";
alias.br = "branch";
alias.ci = "commit";
alias.unstage = "reset HEAD --";
alias.last = "log -1 HEAD";
alias.visual = "!gitk";
};
ignores = [
".DS_Store"
"*.swp"
"*~"
".idea/"
".vscode/"
];
};
# Use git-delta for pretty diffs
programs.delta = {
enable = true;
enableGitIntegration = true;
options = {
navigate = true; # n/N to move between files
light = false; # dark mode
line-numbers = true;
side-by-side = false;
syntax-theme = "Catppuccin Macchiato";
};
};
}