nixos: Add networking.fqdnOrHostName option, readOnly

This commit is contained in:
Robert Hensing 2022-10-06 16:21:09 +02:00
parent b7a6fde153
commit f43716f28e

View file

@ -479,6 +479,22 @@ in
'';
};
networking.fqdnOrHostName = mkOption {
readOnly = true;
type = types.str;
default = if cfg.domain == null then cfg.hostName else cfg.fqdn;
defaultText = literalExpression ''
if cfg.domain == null then cfg.hostName else cfg.fqdn
'';
description = lib.mdDoc ''
Either the fully qualified domain name (FQDN), or just the host name if
it does not exists.
This is a convenience option for modules to read instead of `fqdn` when
a mere `hostName` is also an acceptable value.
'';
};
networking.hostId = mkOption {
default = null;
example = "4e98920d";