Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

maintainers: make `email` optional

Not giving an email address is fine as long as the maintainer is
reachable through other means, such as GitHub or Matrix.

+6 -3
+2 -1
lib/tests/maintainer-module.nix
··· 7 7 type = types.str; 8 8 }; 9 9 email = lib.mkOption { 10 - type = types.str; 10 + type = types.nullOr types.str; 11 + default = null; 11 12 }; 12 13 matrix = lib.mkOption { 13 14 type = types.nullOr types.str;
+4 -2
lib/tests/maintainers.nix
··· 20 20 ]; 21 21 }).config; 22 22 23 - checkGithubId = lib.optional (checkedAttrs.github != null && checkedAttrs.githubId == null) '' 23 + checks = lib.optional (checkedAttrs.github != null && checkedAttrs.githubId == null) '' 24 24 echo ${lib.escapeShellArg (lib.showOption prefix)}': If `github` is specified, `githubId` must be too.' 25 25 # Calling this too often would hit non-authenticated API limits, but this 26 26 # shouldn't happen since such errors will get fixed rather quickly ··· 28 28 id=$(jq -r '.id' <<< "$info") 29 29 echo "The GitHub ID for GitHub user ${checkedAttrs.github} is $id:" 30 30 echo -e " githubId = $id;\n" 31 + '' ++ lib.optional (checkedAttrs.email == null && checkedAttrs.github == null && checkedAttrs.matrix == null) '' 32 + 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.' 31 33 ''; 32 - in lib.deepSeq checkedAttrs checkGithubId; 34 + in lib.deepSeq checkedAttrs checks; 33 35 34 36 missingGithubIds = lib.concatLists (lib.mapAttrsToList checkMaintainer lib.maintainers); 35 37