Start setting up bert
This commit is contained in:
parent
52e33b951c
commit
40bb9b51f6
8 changed files with 226 additions and 0 deletions
14
bert/services/http/home.chandlerswift.com.nix
Normal file
14
bert/services/http/home.chandlerswift.com.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
{
|
||||
services.caddy.virtualHosts."home.chandlerswift.com".extraConfig = ''
|
||||
encode zstd gzip
|
||||
file_server
|
||||
root * /srv/home.chandlerswift.com
|
||||
# hide .git # ???
|
||||
'';
|
||||
systemd.tmpfiles.settings."10-home-chandlerswift-com" = {
|
||||
"/srv/home.chandlerswift.com" = {
|
||||
d = {};
|
||||
};
|
||||
};
|
||||
}
|
||||
12
bert/services/http/index.nix
Normal file
12
bert/services/http/index.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
imports = [
|
||||
./home.chandlerswift.com.nix
|
||||
./maps.chandlerswift.com.nix
|
||||
./stjohnscccc.org.nix
|
||||
];
|
||||
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
email = "chandler@chandlerswift.com";
|
||||
};
|
||||
}
|
||||
14
bert/services/http/maps.chandlerswift.com.nix
Normal file
14
bert/services/http/maps.chandlerswift.com.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
{
|
||||
services.caddy.virtualHosts."maps.chandlerswift.com".extraConfig = ''
|
||||
encode zstd gzip
|
||||
file_server
|
||||
root * /srv/maps.chandlerswift.com
|
||||
# hide .git # ???
|
||||
'';
|
||||
systemd.tmpfiles.settings."10-maps-chandlerswift-com" = {
|
||||
"/srv/maps.chandlerswift.com" = {
|
||||
d = {};
|
||||
};
|
||||
};
|
||||
}
|
||||
42
bert/services/http/stjohnscccc.org.nix
Normal file
42
bert/services/http/stjohnscccc.org.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
let
|
||||
app = "stjohnscccc";
|
||||
domain = "${app}.chandlerswift.com"; # TODO
|
||||
dataDir = "/srv/http/${domain}";
|
||||
in {
|
||||
services.phpfpm.pools.${app} = {
|
||||
user = app;
|
||||
settings = {
|
||||
"listen.owner" = config.services.caddy.user;
|
||||
"pm" = "dynamic";
|
||||
"pm.max_children" = 32;
|
||||
# "pm.max_requests" = 500;
|
||||
"pm.start_servers" = 1;
|
||||
"pm.min_spare_servers" = 1;
|
||||
"pm.max_spare_servers" = 4;
|
||||
"php_admin_value[error_log]" = "stderr";
|
||||
"php_admin_flag[log_errors]" = true;
|
||||
"catch_workers_output" = true;
|
||||
};
|
||||
# phpEnv."PATH" = lib.makeBinPath [ pkgs.php ];
|
||||
};
|
||||
services.caddy.virtualHosts.${domain}.extraConfig = ''
|
||||
root * ${dataDir}/public
|
||||
encode zstd gzip
|
||||
file_server
|
||||
php_fastcgi unix//run/php/php-fpm.sock
|
||||
log
|
||||
'';
|
||||
users.users.${app} = {
|
||||
isSystemUser = true;
|
||||
createHome = true;
|
||||
home = dataDir;
|
||||
group = app;
|
||||
};
|
||||
users.groups.${app} = {};
|
||||
systemd.tmpfiles.settings."10-stjohnscccc.org" = {
|
||||
"/srv/stjohnscccc.org" = {
|
||||
d = {};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue