From 50767ba3d09213daff74538693389ec0c4c151a2 Mon Sep 17 00:00:00 2001 From: Yadunand Prem Date: Tue, 25 Feb 2025 09:35:53 -0500 Subject: [PATCH] feat: add more git defaults --- modules/git.nix | 23 +++++++++++++++++++++++ modules/neovim.nix | 18 +++++++++--------- yadunut-mbp/home.nix | 1 - 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/modules/git.nix b/modules/git.nix index 3874461..63484f3 100644 --- a/modules/git.nix +++ b/modules/git.nix @@ -1,3 +1,5 @@ +# https://blog.gitbutler.com/how-git-core-devs-configure-git/ + {pkgs, ...}: { programs.git-credential-oauth.enable = true; programs.git = { @@ -13,13 +15,34 @@ pull.autostash = true; rebase.autostash = true; + rebase.autosquash = true; push.autoSetupRemote = true; commit.gpgsign = true; commit.verbose = true; + merge.conflictstyle = "zdiff3"; + diff.colorMoved = true; + diff.algorithm = "histogram"; + feature.experimental = true; + branch.sort = "committerdate"; + diff.mnemonicPrefix = true; + fetch.all = true; + column.ui = "auto"; + tags.sort = "version:refname"; + push.followTags = true; + + rerere.enabled = true; + rerere.autoupdate = true; + + rebase.updateRefs = true; + + + + gpg.format = "ssh"; + # credential.helper = "oauth"; credential = { "https://git.yadunut.dev" = { oauthClientId = "a4792ccc-144e-407e-86c9-5e7d8d9c3269"; diff --git a/modules/neovim.nix b/modules/neovim.nix index ab611aa..70a13e4 100644 --- a/modules/neovim.nix +++ b/modules/neovim.nix @@ -30,15 +30,15 @@ sources.formatting.ocamlformat.enable = true; }; lsp = { - package = pkgs.vimUtils.buildVimPlugin { - name = "lsp"; - src = pkgs.fetchFromGitHub { - owner = "neovim"; - repo = "nvim-lspconfig"; - rev = "541f3a2781de481bb84883889e4d9f0904250a56"; - hash = "sha256-f9CqwKBWZgC2ystm+g7FmsHR0fLcM6Wj+GkSwoUIanw="; - }; - }; + # package = pkgs.vimUtils.buildVimPlugin { + # name = "lsp"; + # src = pkgs.fetchFromGitHub { + # owner = "neovim"; + # repo = "nvim-lspconfig"; + # rev = "541f3a2781de481bb84883889e4d9f0904250a56"; + # hash = "sha256-f9CqwKBWZgC2ystm+g7FmsHR0fLcM6Wj+GkSwoUIanw="; + # }; + # }; enable = true; servers = { gleam.enable = true; diff --git a/yadunut-mbp/home.nix b/yadunut-mbp/home.nix index f7d854c..ac2f4a9 100644 --- a/yadunut-mbp/home.nix +++ b/yadunut-mbp/home.nix @@ -40,7 +40,6 @@ pkgs.jq pkgs.nixfmt-rfc-style pkgs.just - pkgs.pyright pkgs.rsync pkgs.k9s pkgs.nil # nix lsp