|
71 | 71 | '';
|
72 | 72 | };
|
73 | 73 |
|
| 74 | + networking.domain = mkOption { |
| 75 | + default = null; |
| 76 | + example = "home.arpa"; |
| 77 | + type = types.nullOr types.str; |
| 78 | + description = '' |
| 79 | + The domain. It can be left empty if it is auto-detected through DHCP. |
| 80 | + ''; |
| 81 | + }; |
| 82 | + |
| 83 | + networking.fqdn = mkOption { |
| 84 | + readOnly = true; |
| 85 | + type = types.str; |
| 86 | + default = |
| 87 | + if (cfg.hostName != "" && cfg.domain != null) then |
| 88 | + "${cfg.hostName}.${cfg.domain}" |
| 89 | + else |
| 90 | + throw '' |
| 91 | + The FQDN is required but cannot be determined. Please make sure that |
| 92 | + both networking.hostName and networking.domain are set properly. |
| 93 | + ''; |
| 94 | + defaultText = literalExpression ''"''${networking.hostName}.''${networking.domain}"''; |
| 95 | + description = '' |
| 96 | + The fully qualified domain name (FQDN) of this host. It is the result |
| 97 | + of combining `networking.hostName` and `networking.domain.` Using this |
| 98 | + option will result in an evaluation error if the hostname is empty or |
| 99 | + no domain is specified. |
| 100 | +
|
| 101 | + Modules that accept a mere `networking.hostName` but prefer a fully qualified |
| 102 | + domain name may use `networking.fqdnOrHostName` instead. |
| 103 | + ''; |
| 104 | + }; |
| 105 | + |
| 106 | + networking.fqdnOrHostName = mkOption { |
| 107 | + readOnly = true; |
| 108 | + type = types.str; |
| 109 | + default = if cfg.domain == null then cfg.hostName else cfg.fqdn; |
| 110 | + defaultText = literalExpression '' |
| 111 | + if cfg.domain == null then cfg.hostName else cfg.fqdn |
| 112 | + ''; |
| 113 | + description = '' |
| 114 | + Either the fully qualified domain name (FQDN), or just the host name if |
| 115 | + it does not exists. |
| 116 | +
|
| 117 | + This is a convenience option for modules to read instead of `fqdn` when |
| 118 | + a mere `hostName` is also an acceptable value; this option does not |
| 119 | + throw an error when `domain` is unset. |
| 120 | + ''; |
| 121 | + }; |
| 122 | + |
74 | 123 | networking.knownNetworkServices = mkOption {
|
75 | 124 | type = types.listOf types.str;
|
76 | 125 | default = [];
|
|
0 commit comments