From 3cf116df99ffc965d711b9b68dcfda864f563888 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Sat, 16 Mar 2024 13:31:19 -0500 Subject: [PATCH] refactor(git): migrate git config to `nix-hm` --- config/default.nix | 84 +++++++++++++++++++++++++++- dots/.config/git/allowed_signers | 1 - dots/.config/git/config | 95 -------------------------------- dots/.config/git/ignore | 8 --- 4 files changed, 83 insertions(+), 105 deletions(-) delete mode 100644 dots/.config/git/allowed_signers delete mode 100644 dots/.config/git/config delete mode 100644 dots/.config/git/ignore diff --git a/config/default.nix b/config/default.nix index 25aa1c3d..e1da9e64 100644 --- a/config/default.nix +++ b/config/default.nix @@ -51,7 +51,6 @@ in { wget rsync readline - git gh ffmpeg silicon @@ -235,6 +234,89 @@ in { source "$HOME/.config/zsh/zsh" ''; }; + git = { + enable = true; + hooks = { pre-commit = ../scripts/check-fmt-git-files.bash; }; + userName = "Price Hiller"; + userEmail = "price@orion-technologies.io"; + aliases = { unstage = "reset HEAD --"; }; + extraConfig = { + init.defaultBranch = "Development"; + merge.conflictstyle = "zdiff3"; + branch.autosetupmerge = "always"; + remote.pushDefault = "origin"; + am.threeWay = true; + apply.ignoreWhitespace = "change"; + # SEC: Integrate https://github.com/git-ecosystem/git-credential-manager with GPG to improve + # security stance around the credential store + credential.helper = "store"; + pull.rebase = true; + commit.gpgsign = true; + transfer.fsckObjects = true; + receive.fsckObjects = true; + status.submoduleSummary = true; + submodule.recurse = true; + fetch = { + fsckObjects = true; + prune = true; + prunetags = true; + }; + rebase = { + autosquash = true; + autostash = true; + updateRefs = true; + }; + log = { + abbrevCommit = true; + decorate = "short"; + date = "iso"; + }; + rerere = { + enabled = true; + autoUpdate = true; + }; + core = { + ignorecase = false; + quotePath = false; + }; + diff = { + colorMoved = "default"; + submodule = "log"; + tool = "nvimdiff"; + }; + push = { + autoSetupRemote = true; + default = "current"; + }; + }; + signing = { + signByDefault = true; + key = "C3FADDE7A8534BEB"; + }; + delta = { + enable = true; + options = { + navigate = true; + features = "interactive decorations"; + interactive = { keep-plus-minus-markers = false; }; + decorations = { + commit-decoration-style = "bold box ul"; + dark = true; + file-style = "omit"; + hunk-header-decoration-style = ''"#022b45" box ul''; + hunk-header-file-style = ''"#999999"''; + hunk-header-style = "file line-number syntax"; + line-numbers = true; + line-numbers-left-style = ''"#022b45"''; + minus-emph-style = ''normal "#80002a"''; + minus-style = ''normal "#330011"''; + plus-emph-style = ''syntax "#003300"''; + plus-style = ''syntax "#001a00"''; + syntax-theme = "Solarized (dark)"; + }; + }; + }; + }; }; qt = { diff --git a/dots/.config/git/allowed_signers b/dots/.config/git/allowed_signers deleted file mode 100644 index b1e3bdd4..00000000 --- a/dots/.config/git/allowed_signers +++ /dev/null @@ -1 +0,0 @@ -price@orion-technologies.io ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILbE2f/zLaYg5VKnWViUrMZVQaQpP+Dm/dkmImK98rPJ sam@orion diff --git a/dots/.config/git/config b/dots/.config/git/config deleted file mode 100644 index 3644fff8..00000000 --- a/dots/.config/git/config +++ /dev/null @@ -1,95 +0,0 @@ -[user] - name = Price Hiller - email = price@orion-technologies.io - signingkey = C3FADDE7A8534BEB - -[init] - defaultBranch = Development - -[core] - pager = delta - ignorecase = false - excludesfile = ~/.config/git/ignore - quotePath = false - -[interactive] - diffFilter = delta --color-only --features=interactive - -[merge] - conflictstyle = zdiff3 - -[diff] - colorMoved = default - submodule = log - tool = nvimdiff - -[delta] - navigate = true - features = decorations interactive - -[delta "interactive"] - keep-plus-minus-markers = false - -[delta "decorations"] - # author: https://github.com/clnoll - commit-decoration-style = bold box ul - dark = true - file-style = omit - hunk-header-decoration-style = "#022b45" box ul - hunk-header-file-style = "#999999" - hunk-header-style = file line-number syntax - line-numbers = true - line-numbers-left-style = "#022b45" - minus-emph-style = normal "#80002a" - minus-style = normal "#330011" - plus-emph-style = syntax "#003300" - plus-style = syntax "#001a00" - syntax-theme = Solarized (dark) - -[pull] - rebase = true -[alias] - unstage = reset HEAD -- -[push] - autoSetupRemote = true - default = current -[merge] - conflictstyle = diff3 -[branch] - autosetupmerge = always -[remote] - pushDefault = origin - -[credential] - helper = store -[commit] - gpgsign = true -[log] - abbrevCommit = true - decorate = short - date = iso -[apply] - ignoreWhitespace = change -[rerere] - enabled = true - autoUpdate = true -[am] - threeWay = true -[gpg "ssh"] - allowedSignersFile = ~/.config/git/allowed_signers -[rebase] - autosquash = true - autostash = true - updateRefs = true -[transfer] - fsckobjects = true -[fetch] - fsckobjects = true - prune = true - prunetags = true -[receieve] - fsckObjects = true -[status] - submoduleSummary = true -[submodule] - recurse = true diff --git a/dots/.config/git/ignore b/dots/.config/git/ignore deleted file mode 100644 index dcd5db5c..00000000 --- a/dots/.config/git/ignore +++ /dev/null @@ -1,8 +0,0 @@ -# vim: set ft=gitignore - -# Ignore project specific configs for neovim -.nvim.lua - -# Ignore all files and folders ending with `.ignore` -.ignore/ -*.ignore