From 9603417da1560d5d2286b1f7b810075f0f6b3067 Mon Sep 17 00:00:00 2001 From: Michael Hoang Date: Mon, 28 Apr 2025 14:20:24 +1000 Subject: [PATCH] networking: allow users to override FQDN Backport of https://github.com/NixOS/nixpkgs/pull/391522 --- modules/networking/default.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/networking/default.nix b/modules/networking/default.nix index cfd74db..e75e234 100644 --- a/modules/networking/default.nix +++ b/modules/networking/default.nix @@ -81,21 +81,22 @@ in }; networking.fqdn = mkOption { - readOnly = true; type = types.str; default = if (cfg.hostName != "" && cfg.domain != null) then "${cfg.hostName}.${cfg.domain}" else throw '' - The FQDN is required but cannot be determined. Please make sure that - both networking.hostName and networking.domain are set properly. + The FQDN is required but cannot be determined from `networking.hostName` + and `networking.domain`. Please ensure these options are set properly or + set `networking.fqdn` directly. ''; defaultText = literalExpression ''"''${networking.hostName}.''${networking.domain}"''; description = '' - The fully qualified domain name (FQDN) of this host. It is the result - of combining `networking.hostName` and `networking.domain.` Using this - option will result in an evaluation error if the hostname is empty or + The fully qualified domain name (FQDN) of this host. By default, it is + the result of combining `networking.hostName` and `networking.domain.` + + Using this option will result in an evaluation error if the hostname is empty or no domain is specified. Modules that accept a mere `networking.hostName` but prefer a fully qualified