mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2025-04-25 16:08:30 +02:00
v4l2, printing and website
This commit is contained in:
parent
82ca5d6146
commit
0ac9348fd2
7 changed files with 91 additions and 25 deletions
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
# set default options for virtualHosts
|
||||
options = with lib; {
|
||||
|
@ -35,8 +35,32 @@
|
|||
add_header Access-Control-Allow-Origin *;
|
||||
return 200 '${builtins.toJSON data}';
|
||||
'';
|
||||
user = "rfive-web";
|
||||
group = "rfive-web";
|
||||
in
|
||||
{
|
||||
users.users.${user} = {
|
||||
group = group;
|
||||
isSystemUser = true;
|
||||
};
|
||||
users.groups.${group} = { };
|
||||
services.phpfpm.pools.rfivede = {
|
||||
user = user;
|
||||
group = group;
|
||||
settings = {
|
||||
"listen.owner" = config.services.nginx.user;
|
||||
"pm" = "dynamic";
|
||||
"pm.max_children" = 32;
|
||||
"pm.max_requests" = 500;
|
||||
"pm.start_servers" = 2;
|
||||
"pm.min_spare_servers" = 2;
|
||||
"pm.max_spare_servers" = 5;
|
||||
"php_admin_value[error_log]" = "stderr";
|
||||
"php_admin_flag[log_errors]" = true;
|
||||
"catch_workers_output" = true;
|
||||
};
|
||||
phpEnv."PATH" = lib.makeBinPath [ pkgs.php ];
|
||||
};
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
|
@ -49,8 +73,27 @@
|
|||
enableACME = true;
|
||||
forceSSL = true;
|
||||
root = "/srv/web/${config.networking.domain}";
|
||||
locations."/.well-known/matrix/client".extraConfig = mkWellKnown clientConfig;
|
||||
locations."/.well-known/matrix/server".extraConfig = mkWellKnown serverConfig;
|
||||
extraConfig = ''
|
||||
index index.html index.php;
|
||||
'';
|
||||
locations = {
|
||||
"/" = {
|
||||
tryFiles = "$uri $uri/ /index.php?$query_string";
|
||||
};
|
||||
"~ \.php$" = {
|
||||
extraConfig = ''
|
||||
try_files $uri =404;
|
||||
fastcgi_pass unix:${config.services.phpfpm.pools.rfivede.socket};
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_index index.php;
|
||||
include ${pkgs.nginx}/conf/fastcgi_params;
|
||||
include ${pkgs.nginx}/conf/fastcgi.conf;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
|
||||
'';
|
||||
};
|
||||
"/.well-known/matrix/client".extraConfig = mkWellKnown clientConfig;
|
||||
"/.well-known/matrix/server".extraConfig = mkWellKnown serverConfig;
|
||||
};
|
||||
};
|
||||
};
|
||||
security.acme = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue