git: move less-important settings/packages to workstation.nix
Alan Pearce alan@alanpearce.eu
Thu, 20 Mar 2025 23:42:42 +0100
2 files changed, 48 insertions(+), 54 deletions(-)
M user/settings/git.nix → user/settings/git.nix
@@ -1,26 +1,11 @@ { config , pkgs , ... -}: -let - name = "Alan Pearce"; - email = "alan@alanpearce.eu"; -in -{ +}: { programs.git = { enable = true; - userName = name; - userEmail = email; - delta = { - enable = false; - options = { - navigate = true; - light = true; - }; - }; - difftastic = { - enable = true; - }; + userName = "Alan Pearce"; + userEmail = "alan@alanpearce.eu"; extraConfig = { init = { defaultBranch = "main"; @@ -69,10 +54,6 @@ autoupdate = true; }; merge = { conflictStyle = "zdiff3"; - }; - "merge.mergiraf" = { - name = "mergiraf"; - driver = "${pkgs.mergiraf}/bin/mergiraf merge --git %O %A %B -s %S -x %X -y %Y -p %P -l %L"; }; diff = { algorithm = "histogram"; @@ -143,39 +124,8 @@ ".\#*" ".tabnine_root" ]; }; - 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 = { - inherit name email; - }; - 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 - ''); - }; home.packages = with pkgs; [ - git-extras # delete-merged-branches and friends - git-worktree-switcher ghq - # reduce these on server - mergiraf - gitui - gitstatus - hut # sourcehut tools + gst ]; }
M user/settings/workstation.nix → 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 @@ -21,5 +27,43 @@ ]); 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 + ''); }; }