From 52692e299d72b5b42cf0451f9769d6f82229d692 Mon Sep 17 00:00:00 2001 From: arcnmx Date: Tue, 12 Mar 2019 01:36:17 -0700 Subject: [PATCH] git: make `userName` and `userEmail` options optional --- modules/programs/git.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/programs/git.nix b/modules/programs/git.nix index 71d79b019..a71169cec 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 = {