From 0a25820e48356101d82315a8466ebe7af2350e31 Mon Sep 17 00:00:00 2001 From: ahmza Date: Wed, 5 Aug 2026 21:51:22 +0100 Subject: [PATCH] manage global git config declaratively via programs.git.config moves user identity and init.defaultBranch into /etc/gitconfig instead of stow-managed dotfiles. note: a per-user ~/.gitconfig still overrides these, so identity must stay out of the stow repo to avoid shadowing. --- modules/features/git/default.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/modules/features/git/default.nix b/modules/features/git/default.nix index 2802daf..05e94d5 100644 --- a/modules/features/git/default.nix +++ b/modules/features/git/default.nix @@ -1,11 +1,23 @@ {...}: { - # git user config (~/.config/git or ~/.gitconfig) is managed via stow. - # We only install git + related tooling and enable the gpg agent. + # Global git config lives in /etc/gitconfig via programs.git.config. + # Note: a per-user ~/.gitconfig (or ~/.config/git/config) overrides these, + # so keep identity out of the stow dotfiles to avoid shadowing this. flake.nixosModules.git = {pkgs, ...}: { + programs.git = { + enable = true; + config = { + user = { + name = "ahmza"; + email = "hamza@ahmza.com"; + }; + init.defaultBranch = "main"; + }; + }; + environment.systemPackages = with pkgs; [ - git git-secret ]; + programs.gnupg.agent = { enable = true; pinentryPackage = pkgs.pinentry-all;