-{ pkgs, lib, ... }:
+{ pkgs, lib, config, ... }:
{
- home.packages = [
+ home.packages = lib.mkIf config.programs.git.enable [
pkgs.b4
pkgs.delta
pkgs.difftastic
+ pkgs.git-absorb
+ pkgs.git-bug
pkgs.git-chglog
pkgs.git-cliff
pkgs.git-crypt
+ pkgs.git-extras
pkgs.git-filter-repo
#pkgs.git-publish
pkgs.git-quick-stats
pkgs.tig
];
programs.git = {
- enable = true;
+ enable = lib.mkDefault true;
ignores = [ "*~" "*.swp" ];
package = lib.mkDefault pkgs.gitMinimal;
aliases = {
a = "add";
+ ab = "absorb";
+ abr = "absorb -r";
ap = "add -p";
+ au = "add -u";
authors = "shortlog -s -n";
- bl = "git log -p -M --follow --stat --";
b = "branch";
+ bl = "git log -p -M --follow --stat --";
c = "commit";
ca = "commit --amend";
caa = "commit --amend -C@";
lpg = "log -p --pretty=fuller -g";
p = "push -v";
pf = "push -vf";
- pu = "pull";
+ pl = "pull";
r = "reset";
rh = "reset --hard";
ri = "rebase -i";
};
init.defaultBranch = "main";
merge.tool = "vimdiff";
+ merge.conflictStyle = "zdiff3";
protocol.version = 2;
pull.rebase = true;
push.default = "simple";
# delta
/*
- core.pager = "delta";
- interactive.diffFilter = "${pkgs.delta}/bin/delta --color-only --features=interactive";
+ core.pager = "delta --grep-separator-symbol keep";
+ interactive.diffFilter = "delta --color-only --features=interactive";
delta.features = "decorations";
delta.interactive = {
keep-plus-minus-markers = false;
*/
};
};
- programs.bash = {
+ programs.bash = lib.mkIf config.programs.git.enable {
shellAliases = {
g = "git";
ge = "git-edit-commit";