networking: don't set targetHost if FQDN is not set

This will change in the future once we finish the networking Clan module
and we'll have a reliable way of addressing every node automagically.
Until then, this will have to do.
This commit is contained in:
Michael Hoang
2025-04-02 23:09:04 +09:00
parent d3a8e24319
commit 8b350d4826

View File

@@ -6,7 +6,9 @@
description = ''
The target SSH node for deployment.
By default, the node's fully quantified domain name or hostname will be used.
If {option}`networking.domain` and by extension {option}`networking.fqdn` is set,
then this will use the node's fully quantified domain name, otherwise it will default
to null.
If set to null, only local deployment will be supported.
@@ -16,8 +18,9 @@
- user@machine2.example.com
- root@example.com:2222?IdentityFile=/path/to/private/key&StrictHostKeyChecking=yes
'';
default = "root@${config.networking.fqdnOrHostName}";
defaultText = "root@\${config.networking.fqdnOrHostName}";
default =
if config.networking.domain != null then "root@${config.networking.fqdnOrHostName}" else null;
defaultText = lib.literalExpression ''if config.networking.domain is not null then "root@''${config.networking.fqdnOrHostName}" else null'';
type = lib.types.nullOr lib.types.str;
};
buildHost = lib.mkOption {