diff options
| -rw-r--r-- | sys/web/sites/host.nix | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/sys/web/sites/host.nix b/sys/web/sites/host.nix index 62abe1a..c1f028a 100644 --- a/sys/web/sites/host.nix +++ b/sys/web/sites/host.nix @@ -64,16 +64,33 @@ in } '' + config; }; + + userLocations = { + "/${name}" = '' + return 404; + ''; + } // optionalAttrs user.mail.dav { + "/${name}/dav" = '' + proxy_pass http://unix:/run/host-www/${name}/dav.sock; + ''; + }; in - mapAttrs (_: userLocation) { - "/${name}" = '' - return 404; - ''; - }) + mapAttrs (_: userLocation) userLocations) (filterAttrs (_: user: user.mail.certs != [ ]) users); }; }; }; }; + + systemd.tmpfiles.settings."10-run-host-www" = + concatMapAttrs + (name: _: { + "/run/host-www/${name}".d = { + mode = "0750"; + user = name; + group = "nginx"; + }; + }) + users; }; } |
