mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 15:09:46 +01:00
git: make userName
and userEmail
options optional
This commit is contained in:
parent
fd2bc150d8
commit
52692e299d
1 changed files with 6 additions and 4 deletions
|
@ -88,12 +88,14 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
userName = mkOption {
|
userName = mkOption {
|
||||||
type = types.str;
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
description = "Default user name to use.";
|
description = "Default user name to use.";
|
||||||
};
|
};
|
||||||
|
|
||||||
userEmail = mkOption {
|
userEmail = mkOption {
|
||||||
type = types.str;
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
description = "Default user email to use.";
|
description = "Default user email to use.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -168,8 +170,8 @@ in
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
programs.git.iniContent.user = {
|
programs.git.iniContent.user = {
|
||||||
name = cfg.userName;
|
name = mkIf (cfg.userName != null) cfg.userName;
|
||||||
email = cfg.userEmail;
|
email = mkIf (cfg.userEmail != null) cfg.userEmail;
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.configFile = {
|
xdg.configFile = {
|
||||||
|
|
Loading…
Reference in a new issue