1 { config, lib, pkgs, ... }:
6 cfg = config.services.powerdns;
7 configDir = pkgs.writeTextDir "pdns.conf" "${cfg.extraConfig}";
11 enable = mkEnableOption (lib.mdDoc "PowerDNS domain name server");
13 extraConfig = mkOption {
15 default = "launch=bind";
16 description = lib.mdDoc ''
17 PowerDNS configuration. Refer to
18 <https://doc.powerdns.com/authoritative/settings.html>
19 for details on supported values.
25 config = mkIf cfg.enable {
27 systemd.packages = [ pkgs.pdns ];
29 systemd.services.pdns = {
30 wantedBy = [ "multi-user.target" ];
31 after = [ "network.target" "mysql.service" "postgresql.service" "openldap.service" ];
34 ExecStart = [ "" "${pkgs.pdns}/bin/pdns_server --config-dir=${configDir} --guardian=no --daemon=no --disable-syslog --log-timestamp=no --write-pid=no" ];
41 description = "PowerDNS";
44 users.groups.pdns = {};