···77 type = types.str;
88 };
99 email = lib.mkOption {
1010- type = types.str;
1010+ type = types.nullOr types.str;
1111+ default = null;
1112 };
1213 matrix = lib.mkOption {
1314 type = types.nullOr types.str;
+4-2
lib/tests/maintainers.nix
···2020 ];
2121 }).config;
22222323- checkGithubId = lib.optional (checkedAttrs.github != null && checkedAttrs.githubId == null) ''
2323+ checks = lib.optional (checkedAttrs.github != null && checkedAttrs.githubId == null) ''
2424 echo ${lib.escapeShellArg (lib.showOption prefix)}': If `github` is specified, `githubId` must be too.'
2525 # Calling this too often would hit non-authenticated API limits, but this
2626 # shouldn't happen since such errors will get fixed rather quickly
···2828 id=$(jq -r '.id' <<< "$info")
2929 echo "The GitHub ID for GitHub user ${checkedAttrs.github} is $id:"
3030 echo -e " githubId = $id;\n"
3131+ '' ++ lib.optional (checkedAttrs.email == null && checkedAttrs.github == null && checkedAttrs.matrix == null) ''
3232+ echo ${lib.escapeShellArg (lib.showOption prefix)}': At least one of `email`, `github` or `matrix` must be specified, so that users know how to reach you.'
3133 '';
3232- in lib.deepSeq checkedAttrs checkGithubId;
3434+ in lib.deepSeq checkedAttrs checks;
33353436 missingGithubIds = lib.concatLists (lib.mapAttrsToList checkMaintainer lib.maintainers);
3537