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 81ad9a5e4a
commit 4442dbd871

View File

@@ -6,7 +6,9 @@
description = '' description = ''
The target SSH node for deployment. 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. If set to null, only local deployment will be supported.
@@ -16,8 +18,9 @@
- user@machine2.example.com - user@machine2.example.com
- root@example.com:2222?IdentityFile=/path/to/private/key&StrictHostKeyChecking=yes - root@example.com:2222?IdentityFile=/path/to/private/key&StrictHostKeyChecking=yes
''; '';
default = "root@${config.networking.fqdnOrHostName}"; default =
defaultText = "root@\${config.networking.fqdnOrHostName}"; 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; type = lib.types.nullOr lib.types.str;
}; };
buildHost = lib.mkOption { buildHost = lib.mkOption {