From 1b1f2d2eca06434d12695bd1a8f747d9011b0e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Sat, 28 Dec 2024 17:39:19 +0200 Subject: [PATCH] Revert "ssh_config: rely on dns" This reverts commit 997bdb7978331b4992625085cd683e57a906ae2d. --- modules/base/sshd/default.nix | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/modules/base/sshd/default.nix b/modules/base/sshd/default.nix index 8867699..c655efd 100644 --- a/modules/base/sshd/default.nix +++ b/modules/base/sshd/default.nix @@ -24,10 +24,23 @@ ] (_: null); in lib.mapAttrs (_name: builtins.intersectAttrs sshAttrs) filtered; - extraConfig = '' - Host git.jakstys.lt - HostName ${myData.hosts."fwminex.servers.jakst".jakstIP} - ''; + extraConfig = + '' + Host git.jakstys.lt + HostName ${myData.hosts."fwminex.servers.jakst".jakstIP} + + '' + + (lib.concatMapStringsSep "\n" + (host: '' + Host ${builtins.elemAt (lib.splitString "." host) 0} + HostName ${myData.hosts.${host}.jakstIP} + '') + ( + builtins.attrNames ( + lib.filterAttrs (name: props: name != "fra1-b.servers.jakst" && props ? jakstIP) myData.hosts + ) + ) + ); }; }; }