From 1b360709f835dc509fe52f49605bb01f201a6061 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 24 Jul 2025 23:43:49 +0100 Subject: [PATCH] Refactor --- modules2/git/defaults.nix | 17 ++++++----------- modules2/git/user.nix | 8 ++++++++ 2 files changed, 14 insertions(+), 11 deletions(-) create mode 100644 modules2/git/user.nix diff --git a/modules2/git/defaults.nix b/modules2/git/defaults.nix index cadd46ac..02b8978c 100644 --- a/modules2/git/defaults.nix +++ b/modules2/git/defaults.nix @@ -1,12 +1,8 @@ -{ config, ... }: - { - flake.modules.homeManager.base = hmArgs: { - programs.git = { - userName = config.flake.meta.owner.name; - userEmail = config.flake.meta.owner.email; - - extraConfig = { + flake.modules.homeManager.base = + { config, ... }: + { + programs.git.extraConfig = { branch = { autosetupmerge = true; autosetuprebase = "always"; @@ -16,11 +12,11 @@ checkout.defaultRemote = "origin"; color.ui = true; column.ui = "auto"; - commit.template = "${hmArgs.config.xdg.configHome}/git/message"; + commit.template = "${config.xdg.configHome}/git/message"; core = { editor = "nvim"; - excludesFile = "~/.config/git/ignore"; + excludesFile = "${config.xdg.configHome}/git/ignore"; }; diff.tool = "vimdiff"; @@ -55,5 +51,4 @@ user.signingkey = "~/.ssh/id_rsa.pub"; }; }; - }; } diff --git a/modules2/git/user.nix b/modules2/git/user.nix new file mode 100644 index 00000000..bc3f214f --- /dev/null +++ b/modules2/git/user.nix @@ -0,0 +1,8 @@ +{ config, ... }: + +{ + flake.modules.homeManager.base.programs.git = { + userName = config.flake.meta.owner.name; + userEmail = config.flake.meta.owner.email; + }; +}