aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarcnmx <arcnmx@users.noreply.github.com>2019-03-12 01:36:17 -0700
committerRobert Helgesson <robert@rycee.net>2019-03-17 20:46:00 +0100
commit52692e299d72b5b42cf0451f9769d6f82229d692 (patch)
tree81c7db85e0173599e21fa69b9b28b516e88eea10
parentfd2bc150d85ef3eb2aa1c6d43f2db9e67516c9f4 (diff)
git: make `userName` and `userEmail` options optional
-rw-r--r--modules/programs/git.nix10
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/programs/git.nix b/modules/programs/git.nix
index 71d79b0194c..a71169cec40 100644
--- a/modules/programs/git.nix
+++ b/modules/programs/git.nix
@@ -88,12 +88,14 @@ in
};
userName = mkOption {
- type = types.str;
+ type = types.nullOr types.str;
+ default = null;
description = "Default user name to use.";
};
userEmail = mkOption {
- type = types.str;
+ type = types.nullOr types.str;
+ default = null;
description = "Default user email to use.";
};
@@ -168,8 +170,8 @@ in
home.packages = [ cfg.package ];
programs.git.iniContent.user = {
- name = cfg.userName;
- email = cfg.userEmail;
+ name = mkIf (cfg.userName != null) cfg.userName;
+ email = mkIf (cfg.userEmail != null) cfg.userEmail;
};
xdg.configFile = {