refactor(git): move git home-manager config to its own module

This commit is contained in:
Mohammad Rafiq 2025-02-28 05:02:40 +08:00
parent e6623278a2
commit 09d9eb1d22
3 changed files with 20 additions and 13 deletions

15
modules/home-git.nix Normal file
View file

@ -0,0 +1,15 @@
{
home.sessionVariables.GIT_CONFIG_GLOBAL = "$HOME/.config/git/config";
programs.git = {
enable = true;
userName = "Mohammad Rafiq";
userEmail = "mohammadrafiq567@gmail.com";
extraConfig = {
init.defaultBranch = "prime";
push.autoSetupRemote = true;
pull.rebase = false;
core.editor = "nvim";
};
};
}

View file

@ -1,4 +1,3 @@
{ ... }:
{ {
programs.tmux = { programs.tmux = {
enable = true; enable = true;

View file

@ -2,7 +2,8 @@
{ {
imports = [ imports = [
../../modules/tmux.nix ../../modules/home-git.nix
../../modules/home-tmux.nix
]; ];
home = { home = {
@ -15,23 +16,15 @@
pkgs.fastfetch pkgs.fastfetch
pkgs.wl-clipboard pkgs.wl-clipboard
]; ];
sessionVariables = {
GIT_CONFIG_GLOBAL = "$HOME/.config/git/config";
};
}; };
programs = { programs = {
git = { bash = {
enable = true; enable = true;
userName = "Mohammad Rafiq"; shellAliases = {
userEmail = "mohammadrafiq567@gmail.com"; rebuild = "sudo nixos-rebuild switch --flake";
extraConfig = {
init.defaultBranch = "prime";
push.autoSetupRemote = true;
pull.rebase = false;
}; };
}; };
tealdeer = { tealdeer = {
enable = true; enable = true;
enableAutoUpdates = true; enableAutoUpdates = true;