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.

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