11 cfg = config.services.pdnsd;
15 pdnsdConf = pkgs.writeText "pdnsd.conf" ''
18 cache_dir="${cfg.cacheDir}";
32 enable = mkEnableOption "pdnsd";
36 default = "/var/cache/pdnsd";
37 description = "Directory holding the pdnsd cache";
40 globalConfig = mkOption {
44 Global configuration that should be added to the global directory
49 serverConfig = mkOption {
53 Server configuration that should be added to the server directory
58 extraConfig = mkOption {
62 Extra configuration directives that should be added to
69 config = mkIf cfg.enable {
70 users.users.${pdnsdUser} = {
71 uid = config.ids.uids.pdnsd;
73 description = "pdnsd user";
76 users.groups.${pdnsdGroup} = {
77 gid = config.ids.gids.pdnsd;
80 systemd.services.pdnsd = {
81 wantedBy = [ "multi-user.target" ];
82 after = [ "network.target" ];
84 mkdir -p "${cfg.cacheDir}"
85 touch "${cfg.cacheDir}/pdnsd.cache"
86 chown -R ${pdnsdUser}:${pdnsdGroup} "${cfg.cacheDir}"
88 description = "pdnsd";
90 ExecStart = "${pdnsd}/bin/pdnsd -c ${pdnsdConf}";