1 { config, pkgs, lib, ... }:
6 cfg = config.services.pdnsd;
10 pdnsdConf = pkgs.writeText "pdnsd.conf"
14 cache_dir="${cfg.cacheDir}";
27 { enable = mkEnableOption "pdnsd";
31 default = "/var/cache/pdnsd";
32 description = "Directory holding the pdnsd cache";
35 globalConfig = mkOption {
39 Global configuration that should be added to the global directory
44 serverConfig = mkOption {
48 Server configuration that should be added to the server directory
53 extraConfig = mkOption {
57 Extra configuration directives that should be added to
64 config = mkIf cfg.enable {
65 users.users.${pdnsdUser} = {
66 uid = config.ids.uids.pdnsd;
68 description = "pdnsd user";
71 users.groups.${pdnsdGroup} = {
72 gid = config.ids.gids.pdnsd;
75 systemd.services.pdnsd =
76 { wantedBy = [ "multi-user.target" ];
77 after = [ "network.target" ];
80 mkdir -p "${cfg.cacheDir}"
81 touch "${cfg.cacheDir}/pdnsd.cache"
82 chown -R ${pdnsdUser}:${pdnsdGroup} "${cfg.cacheDir}"
84 description = "pdnsd";
87 ExecStart = "${pdnsd}/bin/pdnsd -c ${pdnsdConf}";