bert: Refactor stjohnscccc.org config

This commit is contained in:
Chandler Swift 2025-02-08 12:04:30 -06:00
parent 54c4b7136d
commit 384f965b3b
Signed by: chandlerswift
GPG key ID: A851D929D52FB93F

View file

@ -1,11 +1,6 @@
{ pkgs, lib, config, ... }:
let
app = "stjohnscccc";
domain = "${app}.chandlerswift.com"; # TODO
dataDir = "/srv/www/stjohnscccc.org";
in {
services.phpfpm.pools.${app} = {
user = app;
{ pkgs, lib, config, ... }: {
services.phpfpm.pools.stjohnscccc = {
user = "stjohnscccc";
settings = {
"listen.owner" = config.services.caddy.user;
"pm" = "dynamic";
@ -20,8 +15,8 @@ in {
};
# phpEnv."PATH" = lib.makeBinPath [ pkgs.php ];
};
services.caddy.virtualHosts.${domain}.extraConfig = ''
root * ${dataDir}/public
services.caddy.virtualHosts."stjohnscccc.org".extraConfig = ''
root * /srv/www/stjohnscccc.org/public
redir /downloads /downloads/
@ -34,7 +29,7 @@ in {
handle {
encode zstd gzip
php_fastcgi unix/${config.services.phpfpm.pools.${app}.socket}
php_fastcgi unix/${config.services.phpfpm.pools.stjohnscccc.socket}
file_server
}
@ -42,12 +37,12 @@ in {
respond "{err.status_code} {err.status_text}"
}
'';
users.users.${app} = {
users.users.stjohnscccc = {
isSystemUser = true;
home = dataDir;
group = app;
home = "/srv/www/stjohnscccc.org";
group = "stjohnscccc";
};
users.groups.${app} = {};
users.groups.stjohnscccc = {};
systemd.tmpfiles.settings."10-stjohnscccc.org" = {
"/srv/www/stjohnscccc.org" = {
d = {};