From 6dc2fc4e448610747a492c6329de7292123c3d5a Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Mon, 21 Jul 2025 18:47:02 +0000 Subject: [PATCH] Add git home module Allows me to avoid configuring my name any time I want to use git --- modules/home/default.nix | 1 + modules/home/git.nix | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 modules/home/git.nix diff --git a/modules/home/default.nix b/modules/home/default.nix index c063724..b50ee95 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -1,6 +1,7 @@ { imports = [ ./fish.nix + ./git.nix ./neovim.nix ]; } diff --git a/modules/home/git.nix b/modules/home/git.nix new file mode 100644 index 0000000..e6da12c --- /dev/null +++ b/modules/home/git.nix @@ -0,0 +1,20 @@ +{ config, configFiles, lib, pkgs, ... }: + +with lib; + +{ + options.myModules.home.git = { + enable = mkEnableOption "custom git configuration"; + }; + + config = mkIf config.myModules.home.git.enable ( + let + configPath = (configFiles + "/users/${config.myModules.home.user}/gitconfig"); + in { + # Use the correct Home Manager option + home.file.".gitconfig" = { + source = configPath; + }; + } + ); +}