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