aboutsummaryrefslogtreecommitdiffstats
path: root/modules/programs/git/default.nix
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-15 00:12:46 +0530
committerArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-15 00:12:46 +0530
commitcee12adb75196823bc79f37435d89fd2f4ce8208 (patch)
tree9f1d26be449b25a42cef04f45b5426e1ce801bf5 /modules/programs/git/default.nix
parente984847aa0b18ca64a1bb043724e1c3f3b36df65 (diff)
downloadhome-manager-config-cee12adb75196823bc79f37435d89fd2f4ce8208.tar.gz
home-manager-config-cee12adb75196823bc79f37435d89fd2f4ce8208.zip
feat: added git-graph for better visualization of git log graphs
The git log graphs lacks customizability so we are using git-graph that has a more verbose configuration and prettier formatting for git log graphs
Diffstat (limited to 'modules/programs/git/default.nix')
-rw-r--r--modules/programs/git/default.nix16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/programs/git/default.nix b/modules/programs/git/default.nix
index cb4519d..0fdc4fa 100644
--- a/modules/programs/git/default.nix
+++ b/modules/programs/git/default.nix
@@ -1,6 +1,7 @@
{
config,
lib,
+ pkgs,
...
}:
@@ -26,6 +27,10 @@
};
config = lib.mkIf config.programs.git.enable {
+ home.packages = with pkgs; [
+ git-graph
+ ];
+
programs.git = {
settings =
lib.recursiveUpdate
@@ -35,6 +40,17 @@
email = config.programs.git.email;
};
core.askPass = "";
+ alias = {
+ # The exclamation mark (!) tells Git to execute this as an external shell command.
+ # This overrides standard git-graph behavior with your custom format string.
+ log-graph = ''
+ !f() {
+ fmt=$(printf '\033[1;34mCommit:\033[0m \033[33m%%h\033[0m%%n\033[1;34mParents:\033[0m \033[35m%%p\033[0m%%n\033[1;34mAuthor:\033[0m \033[32m%%an\033[0m <\033[96m%%ae\033[0m>%%n\033[1;34mDate:\033[0m \033[36m%%ad (%%ar)\033[0m%%n%%n%%B%%n\033[90m--------------------------------------------------------\033[0m')
+
+ git-graph --color always --sparse --style round --format="$fmt"
+ }; f
+ '';
+ };
}
(
lib.optionalAttrs config.programs.git.useSSH {