[shared] Refactor systems

This commit is contained in:
2025-10-14 20:03:28 +02:00
parent 7cbab15cc9
commit af54dea18a
5 changed files with 141 additions and 156 deletions

View File

@@ -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;
};
}