treewide: set defaultText for options using simple path defaults

adds defaultText for all options that set their default to a path expression
using the ubiquitous `cfg` shortcut bindings.
This commit is contained in:
pennae
2021-12-05 20:40:24 +01:00
parent 70b105d1d0
commit e24a8775a8
21 changed files with 79 additions and 23 deletions

View File

@@ -4,6 +4,7 @@ let
json = pkgs.formats.json {};
cfg = config.services.discourse;
opt = options.services.discourse;
# Keep in sync with https://github.com/discourse/discourse_docker/blob/master/image/base/Dockerfile#L5
upstreamPostgresqlVersion = lib.getVersion pkgs.postgresql_13;
@@ -399,6 +400,7 @@ in
domain = lib.mkOption {
type = lib.types.str;
default = cfg.hostname;
defaultText = lib.literalExpression "config.${opt.hostname}";
description = ''
HELO domain to use for outgoing mail.
'';