Merge pull request #197172 from jkarlson/dokuwiki

nixos/dokuwiki: Use stateDir everywhere
This commit is contained in:
Jonas Heinrich 2022-10-23 14:51:52 +02:00 committed by GitHub
commit 65dd4df8a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,7 +7,6 @@ let
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
@ -325,17 +324,17 @@ in
{
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} - -"
"d ${cfg.stateDir}/attic 0750 ${user} ${webserver.group} - -"
"d ${cfg.stateDir}/cache 0750 ${user} ${webserver.group} - -"
"d ${cfg.stateDir}/index 0750 ${user} ${webserver.group} - -"
"d ${cfg.stateDir}/locks 0750 ${user} ${webserver.group} - -"
"d ${cfg.stateDir}/log 0750 ${user} ${webserver.group} - -"
"d ${cfg.stateDir}/media 0750 ${user} ${webserver.group} - -"
"d ${cfg.stateDir}/media_attic 0750 ${user} ${webserver.group} - -"
"d ${cfg.stateDir}/media_meta 0750 ${user} ${webserver.group} - -"
"d ${cfg.stateDir}/meta 0750 ${user} ${webserver.group} - -"
"d ${cfg.stateDir}/pages 0750 ${user} ${webserver.group} - -"
"d ${cfg.stateDir}/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);
@ -359,7 +358,7 @@ in
};
"~ ^/data/" = {
root = "${stateDir hostName}";
root = "${cfg.stateDir}";
extraConfig = "internal;";
};