diff options
author | makefu <github@syntax-fehler.de> | 2017-12-08 13:33:48 +0100 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2017-12-08 13:33:48 +0100 |
commit | 3faa41106961e7a52e9400be23cdf10b64f4932c (patch) | |
tree | ccd6b4f1fea4b58484440da6f613ddbf55b3fe92 /krebs/3modules/zones.nix | |
parent | 04e6eeb7c8e2e3141293a84bc147265725208999 (diff) | |
parent | a9b72bd2901ca232eb7b6523c535c593a36521ef (diff) |
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'krebs/3modules/zones.nix')
-rw-r--r-- | krebs/3modules/zones.nix | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/krebs/3modules/zones.nix b/krebs/3modules/zones.nix new file mode 100644 index 000000000..eb1351866 --- /dev/null +++ b/krebs/3modules/zones.nix @@ -0,0 +1,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; + }; + +} |