From b8e6881d4d5e60f33455fb14163176e4b3cbdbba Mon Sep 17 00:00:00 2001 From: niten Date: Thu, 2 Nov 2023 10:07:51 -0700 Subject: [PATCH] Don't need to joinLines twice --- zone-to-zonefile.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/zone-to-zonefile.nix b/zone-to-zonefile.nix index bc126bb..af226d0 100644 --- a/zone-to-zonefile.nix +++ b/zone-to-zonefile.nix @@ -80,17 +80,17 @@ let makeMetricRecords = metricType: makeSrvRecords "tcp" metricType; - makeHostRecords = hostname: hostData: + makeHostRecords = hostname: + { ipv4-address, ipv6-address, sshfp-records, description, ... }: let - sshfpRecords = - map (sshfp: "${hostname} IN SSHFP ${sshfp}") hostData.sshfp-records; + sshfpRecords = map (sshfp: "${hostname} IN SSHFP ${sshfp}") sshfp-records; aRecord = optional (hostData.ipv4-address != null) - "${hostname} IN A ${hostData.ipv4-address}"; + "${hostname} IN A ${ipv4-address}"; aaaaRecord = optional (hostData.ipv6-address != null) - "${hostname} IN AAAA ${hostData.ipv6-address}"; + "${hostname} IN AAAA ${ipv6-address}"; descriptionRecord = optional (hostData.description != null) - ''${hostname} IN TXT "${hostData.description}"''; - in joinLines (aRecord ++ aaaaRecord ++ sshfpRecords ++ descriptionRecord); + ''${hostname} IN TXT "${description}"''; + in aRecord ++ aaaaRecord ++ sshfpRecords ++ descriptionRecord; cnameRecord = alias: host: "${alias} IN CNAME ${host}";