git: make userName and userEmail options optional

(cherry picked from commit 52692e299d)
This commit is contained in:
arcnmx 2019-03-12 01:36:17 -07:00 committed by Robert Helgesson
parent 9901509ef8
commit 2b19f15be3
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -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 = {