nixos: Add networking.fqdnOrHostName option, readOnly

Changed files
+16
nixos
modules
+16
nixos/modules/tasks/network-interfaces.nix
···
'';
};
+
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";