From 2f84d15c18c5606ff7cf714b4626a1199393acd8 Mon Sep 17 00:00:00 2001 From: Nathan McCarty Date: Fri, 29 Nov 2024 05:21:22 +0000 Subject: [PATCH] Add git config --- home-manager/machines/wsl/home.nix | 1 + home-manager/modules/programs/git.nix | 91 +++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 home-manager/modules/programs/git.nix diff --git a/home-manager/machines/wsl/home.nix b/home-manager/machines/wsl/home.nix index 98da1cc..8fcd862 100644 --- a/home-manager/machines/wsl/home.nix +++ b/home-manager/machines/wsl/home.nix @@ -22,6 +22,7 @@ imports = [ ../../modules/programs/shell.nix ../../modules/programs/neovim.nix + (import ../../modules/programs/git.nix { }) ]; home.username = "nathan"; home.homeDirectory = "/home/nathan/"; diff --git a/home-manager/modules/programs/git.nix b/home-manager/modules/programs/git.nix new file mode 100644 index 0000000..1dace2b --- /dev/null +++ b/home-manager/modules/programs/git.nix @@ -0,0 +1,91 @@ +{ }: +{ + config, + lib, + pkgs, + ... +}: + +{ + programs.git = { + enable = true; + package = pkgs.gitAndTools.gitFull; + userName = lib.mkDefault "Nathan McCarty"; + userEmail = lib.mkDefault "thatonelutenist@stranger.systems"; + ignores = [ + "**/*~" + "*~" + "*_archive" + "/auto/" + "auto-save-list" + ".cask/" + ".dir-locals.el" + "dist/" + "**/.DS_Store" + "*.elc" + "/elpa/" + "/.emacs.desktop" + "/.emacs.desktop.lock" + "/eshell/history" + "/eshell/lastdir" + "flycheck_*.el" + "*_flymake.*" + "/network-security.data" + ".org-id-locations" + ".persp" + ".projectile" + "*.rel" + "/server/" + "tramp" + "\\#*\\#" + ]; + delta.enable = true; + lfs.enable = true; + extraConfig = { + init = { + defaultBranch = "trunk"; + }; + log = { + showSignature = true; + abbrevCommit = true; + follow = true; + decorate = false; + }; + rerere = { + enable = true; + autoupdate = true; + }; + merge = { + ff = "only"; + conflictstyle = "diff3"; + }; + push = { + default = "simple"; + followTags = true; + }; + pull = { + rebase = true; + }; + status = { + showUntrackedFiles = "all"; + }; + transfer = { + fsckobjects = true; + }; + color = { + ui = "auto"; + }; + diff = { + mnemonicPrefix = true; + renames = true; + wordRegex = "."; + submodule = "log"; + }; + # credential = { helper = "cache"; }; + # Disable annoying safe directory nonsense + safe = { + directory = "*"; + }; + }; + }; +}