summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/default.nix
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2016-04-18 15:10:43 +0200
committerlassulus <lass@aidsballs.de>2016-04-18 15:10:43 +0200
commitc7a6e74b3d151ec480bf5dfbb6e6acb612a88043 (patch)
treef5284434d3c70ea2651deea6df9d7b11200cb783 /krebs/3modules/default.nix
parent3e59f5fb4c9d110d5f91d60c875ca49a414c2a6f (diff)
parent066381dff01f51dd24a829d6cf9de9f6465534f3 (diff)
Merge remote-tracking branch 'cd/master'
Diffstat (limited to 'krebs/3modules/default.nix')
-rw-r--r--krebs/3modules/default.nix23
1 files changed, 20 insertions, 3 deletions
diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix
index be530d46f..9dac50d55 100644
--- a/krebs/3modules/default.nix
+++ b/krebs/3modules/default.nix
@@ -218,7 +218,7 @@ let
(filter (hasSuffix ".${cfg.search-domain}")
longs);
add-port = a:
- if net.ssh.port != null
+ if net.ssh.port != 22
then "[${a}]:${toString net.ssh.port}"
else a;
in
@@ -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