feat: complete git.nix with LFS, credentials, gpg, aliases
This commit is contained in:
parent
c293fc929e
commit
666f10ad06
1 changed files with 41 additions and 1 deletions
40
home/git.nix
40
home/git.nix
|
|
@ -3,18 +3,58 @@
|
|||
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";
|
||||
};
|
||||
|
||||
# Extra config that doesn't fit standard options
|
||||
extraConfig = {
|
||||
# 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/"
|
||||
];
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue