nix-files/hosts/common/programs/git.nix

37 lines
1.0 KiB
Nix
Raw Normal View History

{ lib, pkgs, ... }:
let
mkCfg = lib.generators.toINI { };
in
{
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>
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";
alias.co = "checkout";
alias.cp = "cherry-pick";
alias.d = "difftool";
2023-06-29 22:45:07 +00:00
alias.dif = "diff"; # common typo
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
# 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";
stash.showPatch = true;
};
}