{ config, pkgs, lib, ... }: let cfg = config.machine.bind; in with lib; mkIf cfg.enable { services.bind = { enable = cfg.enable; listenOnPort = cfg.port; zones = { ${cfg.domain} = { master = true; file = pkgs.writeText "zone-${cfg.domain}" (builtins.toString cfg.zones.${cfg.domain}); }; }; }; }