From 666f10ad067105257131fd5051b6ade96870ea23 Mon Sep 17 00:00:00 2001 From: mikl Date: Wed, 1 Jul 2026 17:16:04 +0300 Subject: [PATCH] feat: complete git.nix with LFS, credentials, gpg, aliases --- home/git.nix | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/home/git.nix b/home/git.nix index 9c1b0d3..eb25f7f 100644 --- a/home/git.nix +++ b/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/" ]; };