blob: eb135186684f28a22ebba2a0846684b6ec58cde4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
with import <stockholm/lib>;
{ config, ... }: {
config = {
# Implements environment.etc."zones/<zone-name>"
environment.etc = let
stripEmptyLines = s: (concatStringsSep "\n"
(remove "\n" (remove "" (splitString "\n" s)))) + "\n";
all-zones = foldAttrs (sum: current: sum + "\n" +current ) ""
([config.krebs.zone-head-config] ++ combined-hosts);
combined-hosts =
mapAttrsToList (name: getAttr "extraZones") config.krebs.hosts;
in
mapAttrs'
(name: value: {
name = "zones/${name}";
value.text = stripEmptyLines value;
})
all-zones;
};
}
|