summary refs log tree commit diff stats
path: root/user/settings/workstation.nix
diff options
context:
space:
mode:
authorAlan Pearce2025-03-20 23:42:42 +0100
committerAlan Pearce2025-03-20 23:42:42 +0100
commitadd20bcbdb8f8cd91528f8c438aacfdf2317bde4 (patch)
tree8e3704832e2097bb4c76e8561970a3ad21899c93 /user/settings/workstation.nix
parent84b255354f9f9cb84ec38be303fd9f4ff90d6a51 (diff)
downloadnixfiles-main.tar.lz
nixfiles-main.tar.zst
nixfiles-main.zip
git: move less-important settings/packages to workstation.nix HEAD main
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
+    '');
+  };
 }