anchor.diff:    eachSite = cfg.sites;
     user = "dokuwiki";
     webserver = config.services.${cfg.webserver};
  -  stateDir = hostName: "/var/lib/dokuwiki/${hostName}/data";
   
     dokuwikiAclAuthConfig = hostName: cfg: pkgs.writeText "acl.auth-${hostName}.php" ''
       # acl.auth.php
  
positive.code: 
    {
      systemd.tmpfiles.rules = flatten (mapAttrsToList (hostName: cfg: [
        "d ${stateDir hostName}/attic 0750 ${user} ${webserver.group} - -"
        "d ${stateDir hostName}/cache 0750 ${user} ${webserver.group} - -"
        "d ${stateDir hostName}/index 0750 ${user} ${webserver.group} - -"
        "d ${stateDir hostName}/locks 0750 ${user} ${webserver.group} - -"
        "d ${stateDir hostName}/log 0750 ${user} ${webserver.group} - -"
        "d ${stateDir hostName}/media 0750 ${user} ${webserver.group} - -"
        "d ${stateDir hostName}/media_attic 0750 ${user} ${webserver.group} - -"
        "d ${stateDir hostName}/media_meta 0750 ${user} ${webserver.group} - -"
        "d ${stateDir hostName}/meta 0750 ${user} ${webserver.group} - -"
        "d ${stateDir hostName}/pages 0750 ${user} ${webserver.group} - -"
        "d ${stateDir hostName}/tmp 0750 ${user} ${webserver.group} - -"
      ] ++ lib.optional (cfg.aclFile != null) "C ${cfg.aclFile} 0640 ${user} ${webserver.group} - ${pkg hostName cfg}/share/dokuwiki/conf/acl.auth.php.dist"
      ++ lib.optional (cfg.usersFile != null) "C ${cfg.usersFile} 0640 ${user} ${webserver.group} - ${pkg hostName cfg}/share/dokuwiki/conf/users.auth.php.dist"
      ) eachSite);
  
negative.code:           };
  
            "~ ^/data/" = {
              root = "${cfg.stateDir}";
              extraConfig = "internal;";
            };
  
  