From 4442dbd871cb3cf12e24affecfa4c46223e7b5e5 Mon Sep 17 00:00:00 2001 From: Michael Hoang Date: Wed, 2 Apr 2025 23:09:04 +0900 Subject: [PATCH] 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. --- nixosModules/clanCore/networking.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nixosModules/clanCore/networking.nix b/nixosModules/clanCore/networking.nix index 4c8b28c24..4a9b14de9 100644 --- a/nixosModules/clanCore/networking.nix +++ b/nixosModules/clanCore/networking.nix @@ -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 {