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
42
home/git.nix
42
home/git.nix
|
|
@ -3,18 +3,58 @@
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
# Git LFS support
|
||||||
|
lfs.enable = true;
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
user = {
|
user = {
|
||||||
name = "mikl";
|
name = "mikl";
|
||||||
email = "mikl@iscg.dev";
|
email = "mikl@iscg.dev";
|
||||||
};
|
};
|
||||||
|
|
||||||
init.defaultBranch = "main";
|
init.defaultBranch = "main";
|
||||||
|
|
||||||
|
# Always rebase on pull
|
||||||
pull.rebase = true;
|
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 = [
|
ignores = [
|
||||||
".DS_Store"
|
".DS_Store"
|
||||||
"*.swp"
|
"*.swp"
|
||||||
|
"*~"
|
||||||
|
".idea/"
|
||||||
|
".vscode/"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue