2023-05-08 21:41:02 +00:00
|
|
|
{ lib, pkgs, ... }:
|
2022-11-22 05:28:41 +00:00
|
|
|
|
2023-01-27 07:55:38 +00:00
|
|
|
let
|
2023-07-10 06:07:47 +00:00
|
|
|
# TODO: use formats.gitIni or lib.generators.toGitINI
|
|
|
|
# - see: <repo:nixos/nixpkgs:pkgs/pkgs-lib/formats.nix>
|
2023-01-27 07:55:38 +00:00
|
|
|
mkCfg = lib.generators.toINI { };
|
|
|
|
in
|
2022-10-21 15:41:28 +00:00
|
|
|
{
|
2023-05-08 21:41:02 +00:00
|
|
|
sane.programs.git.fs.".config/git/config".symlink.text = mkCfg {
|
2023-05-17 00:26:04 +00:00
|
|
|
# top-level options documented:
|
|
|
|
# - <https://git-scm.com/docs/git-config#_variables>
|
|
|
|
|
2023-01-27 07:55:38 +00:00
|
|
|
user.name = "Colin";
|
|
|
|
user.email = "colin@uninsane.org";
|
2023-05-17 00:26:04 +00:00
|
|
|
|
2023-06-30 23:13:56 +00:00
|
|
|
alias.br = "branch";
|
2023-06-28 00:20:02 +00:00
|
|
|
alias.co = "checkout";
|
|
|
|
alias.cp = "cherry-pick";
|
|
|
|
alias.d = "difftool";
|
2023-06-29 22:45:07 +00:00
|
|
|
alias.dif = "diff"; # common typo
|
2023-06-28 00:20:02 +00:00
|
|
|
alias.difsum = "diff --compact-summary"; #< show only the list of files which changed, not contents
|
|
|
|
alias.rb = "rebase";
|
|
|
|
alias.st = "status";
|
|
|
|
alias.stat = "status";
|
2023-05-17 00:26:04 +00:00
|
|
|
|
2023-01-27 07:55:38 +00:00
|
|
|
# difftastic docs:
|
|
|
|
# - <https://difftastic.wilfred.me.uk/git.html>
|
|
|
|
diff.tool = "difftastic";
|
|
|
|
difftool.prompt = false;
|
|
|
|
"difftool \"difftastic\"".cmd = ''${pkgs.difftastic}/bin/difft "$LOCAL" "$REMOTE"'';
|
|
|
|
# now run `git difftool` to use difftastic git
|
2023-05-17 00:26:04 +00:00
|
|
|
|
|
|
|
# render dates as YYYY-MM-DD HH:MM:SS +TZ
|
|
|
|
log.date = "iso";
|
2023-06-25 21:45:47 +00:00
|
|
|
|
2023-07-01 00:55:43 +00:00
|
|
|
sendemail.annotate = "yes";
|
|
|
|
sendemail.confirm = "always";
|
|
|
|
|
2023-06-25 21:45:47 +00:00
|
|
|
stash.showPatch = true;
|
2023-05-08 21:41:02 +00:00
|
|
|
};
|
2022-10-21 15:41:28 +00:00
|
|
|
}
|