From add20bcbdb8f8cd91528f8c438aacfdf2317bde4 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 20 Mar 2025 23:42:42 +0100 Subject: git: move less-important settings/packages to workstation.nix --- user/settings/workstation.nix | 44 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'user/settings/workstation.nix') 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 + ''); + }; } -- cgit 1.4.1