[shared] Refactor systems
This commit is contained in:
@@ -5,28 +5,24 @@
|
||||
common,
|
||||
...
|
||||
}:
|
||||
with builtins;
|
||||
|
||||
{
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
matchBlocks = listToAttrs (
|
||||
map (system: {
|
||||
name = system.hostName;
|
||||
value =
|
||||
let
|
||||
hostName =
|
||||
if (system ? address && system.address ? tailnet) then
|
||||
system.address.tailnet
|
||||
else
|
||||
common.tailnetAddr system.hostName;
|
||||
in
|
||||
{
|
||||
port = 22;
|
||||
user = systemConfig.username;
|
||||
hostname = hostName;
|
||||
};
|
||||
}) systems
|
||||
);
|
||||
matchBlocks = builtins.mapAttrs (
|
||||
hostName: system:
|
||||
let
|
||||
_hostName =
|
||||
if (system ? address && system.address ? tailnet) then
|
||||
system.address.tailnet
|
||||
else
|
||||
common.tailnetAddr hostName;
|
||||
in
|
||||
{
|
||||
port = 22;
|
||||
user = systemConfig.username;
|
||||
hostname = _hostName;
|
||||
}
|
||||
) systems;
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user