{ pkgs, inputs, config, ... }: { programs.gh = { enable = true; extensions = with pkgs; [ gh-dash gh-eco gh-actions-cache ]; settings.aliases.co = "pr checkout"; settings.aliases.patch = "!patch2pr"; settings.version = "1"; }; # manual.manpages.enable = true; home.packages = [ # pkgs.git-branchless pkgs.git-gone pkgs.git-cliff # pkgs.git-revise # pkgs.gitAndTools.git-imerge # pkgs.prr inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.prr pkgs.hut inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.imbox # pkgs.radicle-node ]; programs.git = { enable = true; diff-so-fancy.enable = true; lfs.enable = true; attributes = [ "*.ex diff=elixir" "*.exs diff=elixir" "mix.lock merge=binary" "*.erl diff=erlang" "*.hrl diff=erlang" "rebar.lock merge=binary" "*.tex diff=tex" "*.rs diff=rust" "Cargo.lock merge=binary" "*.css diff=css" "*.md diff=markdown" "flake.lock merge=binary" "yarn.lock merge=binary" "*.lockb diff=lockb" ]; ignores = inputs.self.lib.readFileWithComments ./git/ignore; aliases = { b = "branch"; ca = "commit --amend"; ci = "commit"; co = "checkout"; rci = "commit --amend --reuse-message HEAD"; lg = "log --color --graph --abbrev-commit --pretty=simple-oneline"; squash = "!git rebase -i \"$(git merge-base HEAD \"$(git default-branch)\")\""; st = "status -sb"; todo = "grep -Ee '\\\\bTODO:?\\\\b'"; fixme = "grep -Ee '\\\\bFIX(ME)?:?\\\\b'"; default-branch = "!git symbolic-ref --short refs/remotes/origin/HEAD | sed 's|^origin/||'"; cleanup = "!git branch --format=\"%(if:notequals=*)%(HEAD)%(then)%(if:notequals=\${1:-$(git default-branch)})%(refname:lstrip=2)%(then)%(refname:lstrip=2)%(end)%(end)\" --merged \"\$(git default-branch)\" | xargs -rpxL1 git branch -d"; }; extraConfig = { core.commitGraph = true; init.defaultBranch = "master"; user = { name = "Ɓukasz Jan Niemier"; useConfigOnly = true; }; merge = { ff = false; conflictstyle = "zdiff3"; }; branch.autoSetupRebase = "always"; commit = { gpgSign = true; verbose = true; cleanup = "scissors"; }; diff = { indentHeuristic = true; algorithm = "histogram"; mnemonicPrefix = true; renames = "copies"; tool = "difftastic"; markdown.xfuncname = "^(#+\\s+.*)$"; lockb = { textconv = "${pkgs.bun}/bin/bun"; binary = true; }; }; difftool = { prompt = false; difftastic.cmd = "${pkgs.difftastic}/bin/difft \"$LOCAL\" \"$REMOTE\""; }; pager.difftool = true; fetch.prune = true; tag = { forceSignAnnotated = true; sort = "version:refname"; }; versionsort.suffix = ["" "-rc" "-pre"]; push = { default = "simple"; autoSetupRemote = true; followTags = true; gpgSign = "if-asked"; }; pull = { rebase = true; twohead = "ort"; }; rebase = { autostash = true; autosquash = true; updateRefs = true; }; url."git@github.com:".pushInsteadOf = ["https://github.com/" "git://github.com/"]; sendemail = { smtpserver = "${config.programs.msmtp.package}/bin/msmtp"; bcc = config.accounts.email.accounts.hauleth.address; annotate = true; }; maintenance = { # It will ask 1password for access to SSH key/GH token. That is # irritating prefetch.enabled = false; }; pretty = { simple-oneline = "%C(yellow)%h%C(auto)%d %s [%C(green)%aN <%aE>%C(reset)] (%C(blue)%ar%C(reset))"; simple-oneline-sign = "%C(yellow)%h%C(auto)%d %s [%C(green)%aN <%aE>%C(reset)] (%C(blue)%ar%C(reset)) %G?"; }; branchless."revsets.alias".work = "heads(draft())"; }; }; }