Don't need to joinLines twice

This commit is contained in:
niten 2023-11-02 10:07:51 -07:00
parent b18cb5368e
commit b8e6881d4d
1 changed files with 7 additions and 7 deletions

View File

@ -80,17 +80,17 @@ let
makeMetricRecords = metricType: makeSrvRecords "tcp" metricType; makeMetricRecords = metricType: makeSrvRecords "tcp" metricType;
makeHostRecords = hostname: hostData: makeHostRecords = hostname:
{ ipv4-address, ipv6-address, sshfp-records, description, ... }:
let let
sshfpRecords = sshfpRecords = map (sshfp: "${hostname} IN SSHFP ${sshfp}") sshfp-records;
map (sshfp: "${hostname} IN SSHFP ${sshfp}") hostData.sshfp-records;
aRecord = optional (hostData.ipv4-address != null) aRecord = optional (hostData.ipv4-address != null)
"${hostname} IN A ${hostData.ipv4-address}"; "${hostname} IN A ${ipv4-address}";
aaaaRecord = optional (hostData.ipv6-address != null) aaaaRecord = optional (hostData.ipv6-address != null)
"${hostname} IN AAAA ${hostData.ipv6-address}"; "${hostname} IN AAAA ${ipv6-address}";
descriptionRecord = optional (hostData.description != null) descriptionRecord = optional (hostData.description != null)
''${hostname} IN TXT "${hostData.description}"''; ''${hostname} IN TXT "${description}"'';
in joinLines (aRecord ++ aaaaRecord ++ sshfpRecords ++ descriptionRecord); in aRecord ++ aaaaRecord ++ sshfpRecords ++ descriptionRecord;
cnameRecord = alias: host: "${alias} IN CNAME ${host}"; cnameRecord = alias: host: "${alias} IN CNAME ${host}";