aboutsummaryrefslogtreecommitdiffstats
path: root/modules/programs/git
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar@proton.me>2026-04-24 01:48:30 +0530
committerArpit Chakladar <arpitchakladar@proton.me>2026-04-24 01:48:30 +0530
commit3e232a2bc7f5c8ea33804be1ea071a91c5f98055 (patch)
treef772b5d7d393cacf708d845acb75b55c12d3e625 /modules/programs/git
parent606716e0a4b8cbeb9076fb88b6b92664a5a24081 (diff)
downloadhome-manager-config-3e232a2bc7f5c8ea33804be1ea071a91c5f98055.tar.gz
home-manager-config-3e232a2bc7f5c8ea33804be1ea071a91c5f98055.zip
replacing tools with programs to be more consistent with config options
Diffstat (limited to 'modules/programs/git')
-rw-r--r--modules/programs/git/default.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/modules/programs/git/default.nix b/modules/programs/git/default.nix
new file mode 100644
index 0000000..24d63c7
--- /dev/null
+++ b/modules/programs/git/default.nix
@@ -0,0 +1,33 @@
+{ lib, config, ... }:
+
+# Git - Distributed version control system
+{
+ options.programs.git = {
+ username = lib.mkOption {
+ type = lib.types.str;
+ description = "Git username.";
+ };
+ email = lib.mkOption {
+ type = lib.types.str;
+ description = "Git email.";
+ };
+ };
+
+ config = lib.mkIf config.programs.git.enable {
+ programs.git = {
+ settings = {
+ user = {
+ name = config.programs.git.username;
+ email = config.programs.git.email;
+ };
+ credential.helper = "store --file ${config.xdg.cacheHome}/git/credential";
+ core.askPass = "";
+ };
+ };
+
+ # The base directory of the credential file must exist
+ home.activation.createGitCacheDirectory = lib.hm.dag.entryAfter [
+ "writeBoundary"
+ ] "mkdir -p ${config.xdg.cacheHome}/git";
+ };
+}