diff options
author | tv <tv@krebsco.de> | 2016-04-17 10:23:01 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2016-04-17 10:23:01 +0200 |
commit | f5f7abce0d343c20a35bb12c49d03c5bf544d8a9 (patch) | |
tree | c767ea262af1c61df6a580b7ae553e8979e2168a /krebs | |
parent | 377b0dff1ca075a9b57660d8e2ec3596fd3e08e7 (diff) |
krebs: programs.ssh.extraConfig += Host ... Port ...
Diffstat (limited to 'krebs')
-rw-r--r-- | krebs/3modules/default.nix | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix index 10c61b63a..9dac50d55 100644 --- a/krebs/3modules/default.nix +++ b/krebs/3modules/default.nix @@ -228,8 +228,25 @@ let publicKey = host.ssh.pubkey; }) (filterAttrs (_: host: host.ssh.pubkey != null) cfg.hosts); + + programs.ssh.extraConfig = concatMapStrings + (net: '' + Host ${toString (net.aliases ++ net.addrs)} + Port ${toString net.ssh.port} + '') + (filter + (net: net.ssh.port != 22) + (concatMap (host: attrValues host.nets) + (mapAttrsToList + (_: host: recursiveUpdate host + (optionalAttrs (hasAttr config.krebs.search-domain host.nets) { + nets."" = host.nets.${config.krebs.search-domain} // { + aliases = [host.name]; + addrs = []; + }; + })) + config.krebs.hosts))); } ]; -in -out +in out |