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.
This commit is contained in:
@@ -1,11 +1,23 @@
|
|||||||
{...}: {
|
{...}: {
|
||||||
# git user config (~/.config/git or ~/.gitconfig) is managed via stow.
|
# Global git config lives in /etc/gitconfig via programs.git.config.
|
||||||
# We only install git + related tooling and enable the gpg agent.
|
# 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, ...}: {
|
flake.nixosModules.git = {pkgs, ...}: {
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
user = {
|
||||||
|
name = "ahmza";
|
||||||
|
email = "hamza@ahmza.com";
|
||||||
|
};
|
||||||
|
init.defaultBranch = "main";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
git
|
|
||||||
git-secret
|
git-secret
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.gnupg.agent = {
|
programs.gnupg.agent = {
|
||||||
enable = true;
|
enable = true;
|
||||||
pinentryPackage = pkgs.pinentry-all;
|
pinentryPackage = pkgs.pinentry-all;
|
||||||
|
|||||||
Reference in New Issue
Block a user