about summary refs log tree commit diff
path: root/modules/user/aszlig/profiles/workstation
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2021-07-22 02:06:39 +0200
committeraszlig <aszlig@nix.build>2021-07-22 02:14:15 +0200
commit5de32f4fed13bebb23a958ffb501e782a77dd321 (patch)
tree2164407bc9c5fa6e861d0a73b77b36f16db7d034 /modules/user/aszlig/profiles/workstation
parenta3a921c0acea92ea0a0a3afc5ead5bf1a5cdaee5 (diff)
workstation: Switch Git diff viewer to delta
I'm already using this config since a few months and since I'm slowly
getting used to it, let's try to make it the default for my workstation
profile.

Unfortunately, libgit2 uses the Git configuration from /etc, but our
configuration is directly patched into Git and not in /etc but in
"${pkgs.git}/etc", so we need to patch libgit2 to use the right
configuration file.

Another goof is that we can't use ${pkgs.delta} directly in our Git
configuration because it would introduce a circular dependency between
Git itself and delta (which uses libgit2 which in turn refers to
"${pkgs.git}/etc"), so for the time being I'm relying on $PATH for
delta.

Signed-off-by: aszlig <aszlig@nix.build>
Diffstat (limited to 'modules/user/aszlig/profiles/workstation')
-rw-r--r--modules/user/aszlig/profiles/workstation/default.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/user/aszlig/profiles/workstation/default.nix b/modules/user/aszlig/profiles/workstation/default.nix
index 5e1976a8..a2958f36 100644
--- a/modules/user/aszlig/profiles/workstation/default.nix
+++ b/modules/user/aszlig/profiles/workstation/default.nix
@@ -78,6 +78,7 @@ in {
     vuizvui.user.aszlig.programs.mpv.enable = true;
 
     vuizvui.user.aszlig.programs.git.enable = true;
+    vuizvui.user.aszlig.programs.git.delta.enable = true;
     vuizvui.user.aszlig.programs.git.settings = {
       color.ui = "auto";
       user.email = "aszlig@nix.build";
@@ -94,6 +95,18 @@ in {
 
       merge.tool = "vimdiff3";
       merge.conflictstyle = "diff3";
+
+      delta = {
+        commit-decoration-style = "bold yellow box";
+        file-decoration-style = "blue ul";
+        file-style = "bold blue ul";
+        hunk-header-style = "line-number dim italic syntax";
+        hunk-header-decoration-style = "blue";
+        hunk-header-line-number-style = "cyan";
+        plus-style = "syntax auto";
+        minus-style = "syntax auto";
+        line-numbers = true;
+      };
     };
 
     vuizvui.hardware.gameController."03000000ff1100004133000010010000" = {