summary refs log tree commit diff stats
path: root/user/settings/workstation.nix
diff options
context:
space:
mode:
Diffstat (limited to 'user/settings/workstation.nix')
-rw-r--r--user/settings/workstation.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/user/settings/workstation.nix b/user/settings/workstation.nix
index 8ecf1cfb..44a6e6b4 100644
--- a/user/settings/workstation.nix
+++ b/user/settings/workstation.nix
@@ -14,6 +14,12 @@
   home.packages = with pkgs; [
     walk
     nuspell
+    git-extras # delete-merged-branches and friends
+    git-worktree-switcher
+    mergiraf
+    gitui
+    gitstatus
+    hut # sourcehut tools
   ] ++ (with pkgs.hunspellDicts; [
     en-gb-large
     de-de
@@ -22,4 +28,42 @@
   home.shellAliases = {
     wprop = "xprop | egrep '^WM_(CLASS|NAME|WINDOW_ROLE|TYPE)'";
   };
+
+  programs.git = {
+    difftastic = {
+      enable = true;
+    };
+    extraConfig = {
+      "merge.mergiraf" = {
+        name = "mergiraf";
+        driver = "${pkgs.mergiraf}/bin/mergiraf merge --git %O %A %B -s %S -x %X -y %Y -p %P -l %L";
+      };
+    };
+  };
+  programs.gh = {
+    enable = true;
+    settings = {
+      git_protocol = "ssh";
+      aliases = {
+        fork = "repo fork --remote --remote-name alanpearce --default-branch-only";
+      };
+    };
+  };
+  programs.jujutsu = {
+    enable = true;
+    settings = {
+      user = {
+        name = config.programs.git.userName;
+        email = config.programs.git.userEmail;
+      };
+      ui = {
+        "diff.tool" = [ "${pkgs.difftastic}/bin/difft" "--color=always" "$left" "$right" ];
+      };
+    };
+  };
+  xdg.configFile."git/attributes" = {
+    source = (pkgs.runCommandLocal "mergiraf-gitattributes" { } ''
+      ${pkgs.mergiraf}/bin/mergiraf languages --gitattributes >> $out
+    '');
+  };
 }