···124 };
125 hostName = mkOption {
126 type = types.str;
127- default = config.networking.hostName;
0128 example = "somewhere.example.com";
129 description = "DNS name for the urls generated in the cgi.";
130 };
···156 ownerEmail = mkOption {
157 type = types.str;
158 default = "no-reply@${cfg.hostName}";
0159 example = "no-reply@yourdomain.com";
160 description = "Email contact for owner";
161 };
···239 targetConfig = mkOption {
240 type = types.lines;
241 default = ''
242- probe = FPing
243- menu = Top
244- title = Network Latency Grapher
245- remark = Welcome to the SmokePing website of xxx Company. \
246- Here you will learn all about the latency of our network.
247- + Local
248- menu = Local
249- title = Local Network
250- ++ LocalMachine
251- menu = Local Machine
252- title = This host
253- host = localhost
254 '';
255 description = "Target configuration";
256 };
···124 };
125 hostName = mkOption {
126 type = types.str;
127+ default = config.networking.fqdn;
128+ defaultText = "\${config.networking.fqdn}";
129 example = "somewhere.example.com";
130 description = "DNS name for the urls generated in the cgi.";
131 };
···157 ownerEmail = mkOption {
158 type = types.str;
159 default = "no-reply@${cfg.hostName}";
160+ defaultText = "no-reply@\${hostName}";
161 example = "no-reply@yourdomain.com";
162 description = "Email contact for owner";
163 };
···241 targetConfig = mkOption {
242 type = types.lines;
243 default = ''
244+ probe = FPing
245+ menu = Top
246+ title = Network Latency Grapher
247+ remark = Welcome to the SmokePing website of xxx Company. \
248+ Here you will learn all about the latency of our network.
249+ + Local
250+ menu = Local
251+ title = Local Network
252+ ++ LocalMachine
253+ menu = Local Machine
254+ title = This host
255+ host = localhost
256 '';
257 description = "Target configuration";
258 };
···398 '';
399 };
400401+ networking.fqdn = mkOption {
402+ readOnly = true;
403+ type = types.str;
404+ default = if (cfg.hostName != "" && cfg.domain != null)
405+ then "${cfg.hostName}.${cfg.domain}"
406+ else throw ''
407+ The FQDN is required but cannot be determined. Please make sure that
408+ both networking.hostName and networking.domain are set properly.
409+ '';
410+ defaultText = literalExample ''''${networking.hostName}.''${networking.domain}'';
411+ description = ''
412+ The fully qualified domain name (FQDN) of this host. It is the result
413+ of combining networking.hostName and networking.domain. Using this
414+ option will result in an evaluation error if the hostname is empty or
415+ no domain is specified.
416+ '';
417+ };
418+419 networking.hostId = mkOption {
420 default = null;
421 example = "4e98920d";