mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08:00
git: make userName and userEmail options optional
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user